Hello,
My raw csv file is in a weird format, causing the first data point I need to be imported as the header, which is not what I want. So I created a new, blank row at the top, and am trying to figure out how I can pull the column name into the blank row before renaming the header? Any help is appreciated!
names default to here(1);
dt=current data table();
For (i=1, i<=2, i++,
Row(1)[i] = Char(Column Name(i));
);
You should be able to modify the settings to compensate for the weird format in your csv file. Below is a simple script that open a csv file, and you can change the Column Names Start() and the Data Starts() parameters so that you do not end up with bad headers or data.
Open(
"Path to your csv file",
Import Settings(
End Of Line( CRLF, CR, LF ),
End Of Field( Comma, CSV( 1 ) ),
Strip Quotes( 0 ),
Use Apostrophe as Quotation Mark( 0 ),
Use Regional Settings( 0 ),
Scan Whole File( 1 ),
Treat empty columns as numeric( 0 ),
CompressNumericColumns( 0 ),
CompressCharacterColumns( 0 ),
CompressAllowListCheck( 0 ),
Labels( 1 ),
Column Names Start( 1 ),
Data Starts( 2 ),
Lines To Read( "All" ),
Year Rule( "20xx" )
)
);
These JSL statements were retrieved by just opening up a csv file, and then looking in the Source by right clicking on the green triangle in front of the Source entry in the Tables Panel at the left of the opened data table.
You might want to try another option.
- Click on Open
- Navigate to the folder where the csv file is
- Single click on the csv file you want to open
- A list of options will be displayed, select "Data (Using Preview)"

- Click Open
- Go through the input Wizard. Start by unselecting "File contains column names on line:"