Page 1 of 1
Reading ASCII X-Y data, bypassing header lines
Posted: Fri Feb 11, 2005 2:39 pm
by Bob Clancy
I'm a brand-new user, searched the forum, and tried the Dplot help... but couldn't come up with a way to do this simple thing: I have ascii XY or implicit-X files with up to 250 lines of header info that I need to skip over, either by parsing the characters or simply saying "skip 32 lines, then read the data". The last line also has the values "-999 -999 -999 -999", which I'd like to skip also, as that messes up the plot.
Any suggestions?
Posted: Fri Feb 11, 2005 3:47 pm
by DPlotAdmin
Any suggestions?
Notepad
I can change things so that DPlot reads up to 250 lines before giving up (currently the limit is 50) but I'm a bit reluctant to do this. Reluctant mainly because when you drag-and-drop or "Open Wit
h" a file in Explorer, DPlot has to guess at the file format. So if I change the limit to 250 lines, that's 200 additional lines of text that DPlot will have to read to figure out that a file is
not multiple columns of numbers, and this will effect all users. What I might do instead is offer an upper limit setting that in your case you'd set at 250 (or whatever). OR I might differentiate between opening a file with File>Open vs. drag-and-drop or Open Wit
h, and with File>Open present you with a few options if the first attempt to read the file fails.
For your "-999 -999 -999 -999" line, if you have no X values < -999 then the easiest thing to do is Edit>Truncate with the lower limit set to -998 and the upper limit set to some very large value. For the case of implict X values, Edit>Clip Y does the same thing.