Subscribe Bookmark RSS Feed

Suppressing Data Preview


Community Trekker


Jun 23, 2011

I am working on a script to process data files and used the built in script function to generate code.  I copy the code from "Source" script and if I run it the data table is recreated as desired.  Note: I changed the file name here to protect some confidentiality.  I am attempting to read some header information for the report.

If I change   "Quoted file Name.csv" to the pick file() function, the data preview window is forced open and the user has to reset all the settings.  I have used the same structure before to open the files without the data preview being presented.  The only differences here is that I am not reading column labels here as compared to the previous instance.


  "Quoted file Name.csv",


  Column( "Column 1", Character, "Nominal" ),

  Column( "Column 2", Character, "Nominal" ),

  Column( "Column 3", Character, "Nominal" ),

  Column( "Column 4", Character, "Nominal" ),

  Column( "Column 5", Character, "Nominal" ),

  Column( "Column 6", Character, "Nominal" ),

  Column( "Column 7", Numeric, "Continuous", Format( "Best", 10 ) )


  Import Settings(

  End Of Line( CRLF, CR, LF ),

  End Of Field( Comma, CSV( 1 ) ),

  Strip Quotes( 1 ),

  Use Apostrophe as Quotation Mark( 0 ),

  Scan Whole File( 1 ),

  Treat empty columns as numeric( 0 ),

  CompressNumericColumns( 0 ),

  CompressCharacterColumns( 0 ),

  CompressAllowListCheck( 0 ),

  Labels( 0 ),

  Column Names Start( 1 ),

  Data Starts( 1 ),

  Lines To Read( 7 ),

  Year Rule( "20xx" )




Community Manager


Jun 23, 2011

It looks like this is a bug.

Pick File() isn't actually importing the file when you go through the preview wizard, but if that's the option chosen in the open dialog presented by Pick File() JMP progresses to the wizard. It really shouldn't. I'll see if we can get that corrected in a future release.

You can prove that Pick File() isn't importing the file by making any changes to the settings in the data preview and seeing that they don't do anything. The Import Settings() in your script are used.

In your case, I think that the Open As: Data (with Preview) is the default because that's what you had chosen the last time through the File -> Open... dialog. Choosing one of the other options (e.g. Data, using best guess) will avoid the rest of the wizard.





Mar 21, 2013

Nicely diagnosed Jeff.  The file open dialog does open the wizard to get the import options, then ignores them and just returns the filename.  (But the options are used if the file open dialog is launched from the File->Open menu.)




Mar 21, 2013

While fixing this I discovered an easy some parameters to pick file().  Just the first parameter (the dialog caption text) is enough, but you might want to specify the filters too.

pickfile("what file would you like?")


This avoids adding the text import widgets to the window.