cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
] />

Discussions

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

Import multiple .csv files where "Number of Header Lines" and "First Data Line" vary by file

We can import multiple files using "Multiple File Import".  I have a large number of .csv files to import where the First Header Line is always "1", but the "Number of Header Lines" and consequently, the "First Data Line" may vary between files.  For each file, I can potentially use a value in another column to count the "Number of Header Lines", and can also use the first instance of a particular value in that column to denote where the "First Data Line" is, but I am unsure how to script this using JSL.  Any help is appreciated.

ashwint27_0-1776978809987.png

 

2 REPLIES 2
txnelson
Super User

Re: Import multiple .csv files where "Number of Header Lines" and "First Data Line" vary by file

The only way that I have solved this problem was to write some JSL that loops through the target directory, using JMP defaults to read in the first .csv file.  Then read through the data table and detecting the row the first real data are found.  Once found I set a variable to the row number.  I stop the looping and delete the data table.  Then I create the JSL that will read the .csv file correctly, and then read in the file.  I then repeat the process for each file.

Jim
jthi
Super User

Re: Import multiple .csv files where "Number of Header Lines" and "First Data Line" vary by file

Sometimes you can also import all the files as raw as possible using multiple file import and then perform the cleanup in the table.

-Jarmo

Recommended Articles