cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • 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.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

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

How to make JSL save empty CSV file?

Is there any way to make JSL save an empty CSV file (meaning only column headers present)?

I would expect JSL to save the CSV file with the 1 row of column headers (and no other rows).  But instead JSL errors out.

I'm using JMP 11.1.1.

Let me know if you know any solutions (other than reconstructing the file with concatenation strings and commas and saving). thanks, DJ

3 REPLIES 3
djhanson
Level VI

Re: How to make JSL save empty CSV file?

What's also crazy about this is that Excel lets you save a blank CSV file and JMP itself allows you to load a blank CSV file.

You would think if JMP doesn't care about loading a blank CSV file why would it now allow saving a blank CSV file?  It's just one row of headers.

pmroz
Super User

Re: How to make JSL save empty CSV file?

You might have to bite the bullet and write out a text file of the column headers.  Not too hard:

dt = New Table( "Example Table", Add Rows( 0 ),

      New Column( "aaaaa", Numeric, Continuous, Format( "Best", 12 ), Set Values( [] ) ),

      New Column( "bbbbb", Numeric, Continuous, Format( "Best", 12 ), Set Values( [] ) ),

      New Column( "ccccc", Numeric, Continuous, Format( "Best", 12 ), Set Values( [] ) ),

      New Column( "ddddd", Numeric, Continuous, Format( "Best", 12 ), Set Values( [] ) )

);

col_names = dt << get column names(string);

text2save = concat items(col_names, ",");

csvfile = "c:\temp\csv_example.csv";

save text file(csvfile, text2save);

Craige_Hales
Super User

Re: How to make JSL save empty CSV file?

Thanks!  JMP 13 will do it. 

Craige

Craige

Recommended Articles