cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP Security Notice: CVE-2026-109618 and CVE-2026-109619

    JMP promptly initiated a review of its products, services, and relevant infrastructure for exposure to CVE-2026-109618 and CVE-2026-109619.

    Our assessment of JMP products has not identified exposure to these vulnerabilities. Where remediation was required within supporting environments, appropriate security updates and controls have been applied and validated.

    We have identified no evidence of successful exploitation or unauthorized access to JMP systems or customer information associated with these vulnerabilities.

    JMP continues to monitor the issue and relevant vendor guidance. No action is required by JMP customers at this time.

  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
lala
Level IX

Can simplify the script when opening text files with JSL?

Hello!

For example, if I import a text file like this, if my text file has a large number of columns, 

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << 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" )
	)
);

can these repeated letters be replaced by variables?

 

abc="Numeric, \!"Continuous\!", Format( \!"Best\!", 12 )"

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" )
	)
);

??

Thanks!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
David_Burnham
Super User (Alumni)

Re: Can simplify the script when opening text files with JSL?

You can dramatically simplify the script - you just need to experiment with what is required.  I would always take out the column references and process them after the import, for e3xample:

 

dt = Open("$DOWNLOADS/Big Class.txt");
column(dt,"age") << set modeling type("nominal");
-Dave

View solution in original post

1 REPLY 1
David_Burnham
Super User (Alumni)

Re: Can simplify the script when opening text files with JSL?

You can dramatically simplify the script - you just need to experiment with what is required.  I would always take out the column references and process them after the import, for e3xample:

 

dt = Open("$DOWNLOADS/Big Class.txt");
column(dt,"age") << set modeling type("nominal");
-Dave

Recommended Articles