Missing Comma in CSV File Output
hegedus
open/A resultfileref as "C:\Users\scorpion\Documents\Strain Measurement\strainSummaryResults.txt"
fprintf ResultFileRef, "%s,%g,%g,%s\r\n", Filename,StrainRangeX,StrainRangeY, Secs2Date(DateTime,0)
close resultfileref
The output in the file looks like
Filename,13.5,12.38/12/12
as opposed to
Filename,13.5,12.3,8/12/12
The comma is missing between the third and fourth item. I have stared at the formatting string many a time and the comma is there in the code. Why does it not show up in the file?
String fileName
Variable StrainRangeX,StrainRangeY
Variable resultfileref
open/A/P=home resultfileref as "StrainSummaryResults.txt"
fprintf ResultFileRef, "%s,%g,%g,%s\r\n", Filename,StrainRangeX,StrainRangeY, Secs2Date(DateTime,0)
close resultfileref
End
I tested it by executing:
I then verified the result by opening the file as an Igor notebook.
Perhaps you can come up with a simple example that reproduces the problem.
August 17, 2012 at 05:44 pm - Permalink
"Pilot" error I was looking at obsoleted code snippet for the results logging. Looked at right one saw problem.
Thank you for your time.
August 20, 2012 at 09:19 am - Permalink