Table keep first split characterHi,
I have a CSV file in each row has different pipe | data. The first row is the header name.
Do I loop every single row to get the first word, put it into a new table and export to CSV?
What's the better approach?
The example below is I would keep 1.611120 and ignore the rest.
Word( 1, "1.611120|10.63220|111.0111100|11110.633320|-987654|ABCDE||12222.020|||98|ABCD|", "|" );
Re: Table keep first split characterI suggest you specify to use the Data with Preview option when opening the .csv file. 
It will allow you to specify the "|" as the separator
Which will then end up reading in each of the fields as separate columns.
Which then you can just delete all of the columns you do not want
Re: Table keep first split characterThank you.
I was hoping to automate this with JSL.
Re: Table keep first split characterIf you use the Data Previewer for the first input, you can have JMP provide you with the JSL to open future instances. Once the data table has been created, using the Data Previewer, just go to the "Source" element in the tables panel of the data table, 
right click on green triangle, and select "Edit"

There you will find the JSL required to read in future instances of your .csv file

Because the column names are contained within your .csv file, you can just completly remove the whole Columns() section from the code, and JMP will find all of the columns in your .csv file.
Re: Table keep first split characterJim,
My columns names (first line) are different each time for each .csv file and it is a not a fix column #. I could have 10 columns or 50 columns of pipe data so I cannot hard code Column().
I only want to keep first pipe of the data.
Thanks.
Re: Table keep first split characterAs I had stated in my last response:
"Because the column names are contained within your .csv file, you can just completly remove the whole Columns() section from the code, and JMP will find all of the columns in your .csv file."
So copy and paste the code. Remove the Columns() section of the code. Then change the path to a different .csv file, and you will see that the code will be able to open the new data table.