cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

Discussions

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

Print a list and export as txt file

Would this be possible with JSL?

For convenience sake I would like it to be printed out into a seperate txt file.

 

My scuffed solution would be to print it into the debug log which would also work but you'd have to go into the debug mode everytime you want to look up something.

dt = Current Data Table();
L = dt << Get Column Names(String);
for(i = 1, i < N items(L)+1, i++,
Print(L[i],i); // prints the string in the list and it's position next to it
);
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Print a list and export as txt file

This script will write the column names to the JMP Log, and then will save it to a text file

Names Default To Here( 1 );
dt = Current Data Table();
L = dt << Get Column Names( String );
theText = "";
For( i = 1, i < N Items( L ) + 1, i++,
	Write( L[i] || " " || Char( i ) || "\!n" );
	theText = theText || L[i] || " " || Char( i ) || "\!n";
);
Save Text File( "path/filename.txt", theText );
Jim

View solution in original post

1 REPLY 1
txnelson
Super User

Re: Print a list and export as txt file

This script will write the column names to the JMP Log, and then will save it to a text file

Names Default To Here( 1 );
dt = Current Data Table();
L = dt << Get Column Names( String );
theText = "";
For( i = 1, i < N Items( L ) + 1, i++,
	Write( L[i] || " " || Char( i ) || "\!n" );
	theText = theText || L[i] || " " || Char( i ) || "\!n";
);
Save Text File( "path/filename.txt", theText );
Jim

Recommended Articles