cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar
BabyDoragon
Level II

How to correctly read CSV files that are not entirely in table format in JSL?

View more...
When using JSL and the Open() function to read a CSV file, if there are values in non-primary data columns above as shown in the image, how can I correctly read the values in the columns? Using Open() directly results in an error.

Additionally, if I need to read the IDs above the column data, how should I do that?

BabyDoragon_0-1751532238551.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How to correctly read CSV files that are not entirely in table format in JSL?

Using preview 

jthi_0-1751534696496.png

jthi_1-1751534719326.png

Now you have your data. Do second open with preview but now just pick your metadata

jthi_3-1751534794473.png

Then you can move the data over to your original data in many different ways.

 

After you have this working, you can turn it into a script and loop over your files and repeat the process on all of them. Or optionally you can try to use Multiple File Import to perform as many steps as possible with one MFI run and then cleanup with JSL

-Jarmo

View solution in original post

5 REPLIES 5
jthi
Super User

Re: How to correctly read CSV files that are not entirely in table format in JSL?

Read the CSV interactively with JMP to allow easier reading from specific rows. You can do it multiple times to first get the metadata and in second open get data. Or you can load it is a text file and parse it into JMP table.

-Jarmo
BabyDoragon
Level II

Re: How to correctly read CSV files that are not entirely in table format in JSL?

I know how to read a file directly, but I need to use JSL to read a large number of CSV files of this type.
Using Open() fails to read them. What should I do?

 

BabyDoragon_0-1751533050343.png

 

jthi
Super User

Re: How to correctly read CSV files that are not entirely in table format in JSL?

You haven't provided your file so it is difficult to provide proper examples

-Jarmo
BabyDoragon
Level II

Re: How to correctly read CSV files that are not entirely in table format in JSL?

Attachment is the sample file!~

jthi
Super User

Re: How to correctly read CSV files that are not entirely in table format in JSL?

Using preview 

jthi_0-1751534696496.png

jthi_1-1751534719326.png

Now you have your data. Do second open with preview but now just pick your metadata

jthi_3-1751534794473.png

Then you can move the data over to your original data in many different ways.

 

After you have this working, you can turn it into a script and loop over your files and repeat the process on all of them. Or optionally you can try to use Multiple File Import to perform as many steps as possible with one MFI run and then cleanup with JSL

-Jarmo

Recommended Articles