<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Can simplify the script when opening text files with JSL? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Can-simplify-the-script-when-opening-text-files-with-JSL/m-p/539025#M76015</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;For example, if I import a text file like this, if my text file has a large number of columns,&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt &amp;lt;&amp;lt; Save( "D:\Big.txt" );
Close( dt, nosave );
dt = Open(
	"D:\Big.txt",
	Charset( "gb2312" ),
	columns(
		New Column( "name", Character, "Nominal" ),
		New Column( "age", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "sex", Character, "Nominal" ),
		New Column( "height", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "weight", Numeric, "Continuous", Format( "Best", 12 ) )
	),
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( Comma, CSV( 0 ) ),
		Strip Quotes( 1 ),
		Use Apostrophe as Quotation Mark( 0 ),
		Use Regional Settings( 0 ),
		Scan Whole File( 1 ),
		Treat empty columns as numeric( 0 ),
		CompressNumericColumns( 0 ),
		CompressCharacterColumns( 0 ),
		CompressAllowListCheck( 0 ),
		Labels( 1 ),
		Column Names Start( 1 ),
		Data Starts( 2 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;can these repeated letters be replaced by variables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;abc="Numeric, \!"Continuous\!", Format( \!"Best\!", 12 )"&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open(
	"D:\Big.txt",
	Charset( "gb2312" ),
	columns(
		New Column( "name", Character, "Nominal" ),
		New Column( "age",abc ),
		New Column( "sex", Character, "Nominal" ),
		New Column( "height",abc ),
		New Column( "weight",abc )
	),
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( Comma, CSV( 0 ) ),
		Strip Quotes( 1 ),
		Use Apostrophe as Quotation Mark( 0 ),
		Use Regional Settings( 0 ),
		Scan Whole File( 1 ),
		Treat empty columns as numeric( 0 ),
		CompressNumericColumns( 0 ),
		CompressCharacterColumns( 0 ),
		CompressAllowListCheck( 0 ),
		Labels( 1 ),
		Column Names Start( 1 ),
		Data Starts( 2 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;？？&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 17:08:53 GMT</pubDate>
    <dc:creator>lala</dc:creator>
    <dc:date>2023-06-09T17:08:53Z</dc:date>
    <item>
      <title>Can simplify the script when opening text files with JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-simplify-the-script-when-opening-text-files-with-JSL/m-p/539025#M76015</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;For example, if I import a text file like this, if my text file has a large number of columns,&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt &amp;lt;&amp;lt; Save( "D:\Big.txt" );
Close( dt, nosave );
dt = Open(
	"D:\Big.txt",
	Charset( "gb2312" ),
	columns(
		New Column( "name", Character, "Nominal" ),
		New Column( "age", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "sex", Character, "Nominal" ),
		New Column( "height", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "weight", Numeric, "Continuous", Format( "Best", 12 ) )
	),
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( Comma, CSV( 0 ) ),
		Strip Quotes( 1 ),
		Use Apostrophe as Quotation Mark( 0 ),
		Use Regional Settings( 0 ),
		Scan Whole File( 1 ),
		Treat empty columns as numeric( 0 ),
		CompressNumericColumns( 0 ),
		CompressCharacterColumns( 0 ),
		CompressAllowListCheck( 0 ),
		Labels( 1 ),
		Column Names Start( 1 ),
		Data Starts( 2 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;can these repeated letters be replaced by variables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;abc="Numeric, \!"Continuous\!", Format( \!"Best\!", 12 )"&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open(
	"D:\Big.txt",
	Charset( "gb2312" ),
	columns(
		New Column( "name", Character, "Nominal" ),
		New Column( "age",abc ),
		New Column( "sex", Character, "Nominal" ),
		New Column( "height",abc ),
		New Column( "weight",abc )
	),
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( Comma, CSV( 0 ) ),
		Strip Quotes( 1 ),
		Use Apostrophe as Quotation Mark( 0 ),
		Use Regional Settings( 0 ),
		Scan Whole File( 1 ),
		Treat empty columns as numeric( 0 ),
		CompressNumericColumns( 0 ),
		CompressCharacterColumns( 0 ),
		CompressAllowListCheck( 0 ),
		Labels( 1 ),
		Column Names Start( 1 ),
		Data Starts( 2 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;？？&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:08:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-simplify-the-script-when-opening-text-files-with-JSL/m-p/539025#M76015</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-06-09T17:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Can simplify the script when opening text files with JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/Can-simplify-the-script-when-opening-text-files-with-JSL/m-p/539044#M76016</link>
      <description>&lt;P&gt;You can dramatically simplify the script - you just need to experiment with what is required.&amp;nbsp; I would always take out the column references and process them after the import, for e3xample:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$DOWNLOADS/Big Class.txt");
column(dt,"age") &amp;lt;&amp;lt; set modeling type("nominal");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Aug 2022 11:05:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Can-simplify-the-script-when-opening-text-files-with-JSL/m-p/539044#M76016</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2022-08-31T11:05:29Z</dc:date>
    </item>
  </channel>
</rss>

