cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
blue1994
Level III

Save xlsx to csv file

Hi,

anyone know how to save .xlsx to csv file with jsl? Is it possible to make it?

thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Save xlsx to csv file

names default to here(1);

dt=Open("path to the file.xlsx");

dt<<save as("path to new file.csv");

 

Details can be found at:

     Help==>Scripting Index==>Data Table==>Save As

 

Here is the example from the Scripting Index

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Save( "C:\Big Class.jmp" );
dt << Save( "C:\Big Class.csv" );
Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: Save xlsx to csv file

names default to here(1);

dt=Open("path to the file.xlsx");

dt<<save as("path to new file.csv");

 

Details can be found at:

     Help==>Scripting Index==>Data Table==>Save As

 

Here is the example from the Scripting Index

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Save( "C:\Big Class.jmp" );
dt << Save( "C:\Big Class.csv" );
Jim
nikles
Level VI

Re: Save xlsx to csv file

Hi @txnelson .  I'm curious if you happen to know of a method to convert an xlsx file to csv or text that does not require opening the xlsx as a JMP table first.  I have a few reasons, but the biggest reason is speed.  I've found that I can open a csv as a text string and perform a lot of preprocessing on it before creating the jmp table.  This seems to greatly improve speed, especially when opening multiple dozens of files at once.  My thinking is if I could convert excel tables to csv first, I could use the same script that I already use for opening our csv files into JMP.

 

I've been looking at the possibility of incorporating a python script into my jsl script, but I'm reluctant to require users to have the right python version and libraries on their machines.  Would be nice if there were a way to do it directly.

 

Any thoughts on this are greatly appreciated.  Thanks.

txnelson
Super User

Re: Save xlsx to csv file

There may be a 3rd party shareware product out there that converts xlsx to csv, but there is nothing in native JMP to do that without reading it in as a JMP file first.

Jim
nikles
Level VI

Re: Save xlsx to csv file

Got it. Thanks Jim.