cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use JMP Live to centralize and share reports within groups. Webinar with Q&A April 4, 2pm ET.
Choose Language Hide Translation Bar
View Original Published Thread

End Of Field(other)

KST-CPT
Level II

I have a file (essentially a text file but with .log as the extension).  It is comma seperated.  Contains both character and numeric data.  Every now and then I get a ID number with a comma in it.  This throws the columns off.  looking at the data I see that all the values I want to seperaate actually have a space after the comma. I want to seperate the columns with something like this:

 

For( i = 1 , i <= nf, i++,
filenow = ( filelist[i] );
fileopen=(filepath||filenow);

dt=open(fileopen, "text", End Of Field(Other), EOF Other(", "), Table Contains Column Headers( 0 ));

 

However, the data table is still comma delimeted so that the values I do not want to be delimeted are seperated into 2 columns. Is there a way to ignore the comma in a value such as 12345,6 but keep the delimeters that have a space after them ", "?

 

Thanks

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
vince_faller
Super User (Alumni)


Re: End Of Field(other)

you could preprocess the text file itself to change all of them to tabs then just import like a tsv

 

Names Default to here(1);
file = pick file();
txt = load text file(file);
substitute into(txt, ", ", "\!t");
newfile = convert file path("$TEMP/tempfile.log");
save text file(newfile, txt);


dt=open(newfile, "text", End Of Field("Tab"), Table Contains Column Headers( 0 ));
Vince Faller - Predictum

View solution in original post

2 REPLIES 2
vince_faller
Super User (Alumni)


Re: End Of Field(other)

you could preprocess the text file itself to change all of them to tabs then just import like a tsv

 

Names Default to here(1);
file = pick file();
txt = load text file(file);
substitute into(txt, ", ", "\!t");
newfile = convert file path("$TEMP/tempfile.log");
save text file(newfile, txt);


dt=open(newfile, "text", End Of Field("Tab"), Table Contains Column Headers( 0 ));
Vince Faller - Predictum
KST-CPT
Level II


Re: End Of Field(other)

that worked very nicely, thanks