Agree!
Open( "$SAMPLE_DATA/Big Class.jmp" );
can be used to describe 95% of the questions.
For the remaining ones, please use
Open( "$SAMPLE_DATA")
and invest 2 minutes to find a suitable file.
Much (!!!) better than
Open( "path/to/my/own/file/with/some/user/defined/columns/which/have/to/be/recreated/manually.jmp")
or
// JSL Script for File Import
// Define the file path
filePath = "C:\\Users\\YourUsername\\Documents\\data.csv";
// Check if the file exists
If( !Is File( filePath ),
Throw( "File not found: " || filePath )
);
// Open the file
dataTable = Open( filePath,
// Specify the file type
"CSV",
// Set the delimiter
Import Settings(
End Of Line( CRLF ),
Delimiter( "," ),
// Specify the column names
Columns(
Column( "ID", Numeric ),
Column( "Name", Character ),
Column( "Age", Numeric ),
Column( "Score", Numeric )
),
// Set the data types
Data Type( Numeric, Character, Numeric, Numeric ),
// Set the formats
Format( "Best", "Best", "Best", "Best" ),
// Set the column widths
Column Width( 10, 20, 10, 10 ),
// Set the column labels
Column Label( "ID", "Name", "Age", "Score" )
)
);
// Display the data table
dataTable << Show Window;
// Add a new column
dataTable << New Column( "Grade",
Character,
"Nominal",
Formula(
If( :Score >= 90, "A",
:Score >= 80, "B",
:Score >= 70, "C",
:Score >= 60, "D",
"F"
)
)
);
//stay tuned, just a few more lines - then I will show the issue ...
//...