Loading partial columns from ASCII as wave

Apologies in advance if I'm being incredibly naive. I'm attempting to write a script which would load the numerical values from the first three columns within a .dat file. Complicating the matter is the need for the script to:

1) Only read in part of a column (after row 119 on the files attached) this can easily be achieved using loadwave or xlloadwave.

2) Read in the rest of the column after this row, however the number of points within a column is not constant (it's 88, 217 and 200 points in the attached files) and it would be preferable not to create a wave with NaN values or edit the script of a LoadWave command each time I wanted to use this function!

Is there a way of bypassing the "numlines" value from the /L flag of the LoadWave command that could be used?

Thanks in advance,
Jon
75190.txt (51.55 KB) 75201.txt (22.35 KB) 75207.txt (48.13 KB)
Jonpope wrote:
Is there a way of bypassing the "numlines" value from the /L flag of the LoadWave command that could be used?


Passing 0 for numLines means "auto" and will load all of the rest of the lines in the file. This seems like what you need.

Jon,

It sounds like you want to read in the header info (first 119 lines) and then the first 3 columns of actual data following the header. If that is the case then you probably want to use LoadWave twice, first for the header and then for the data.

Something like:

LoadWave/J/D/E=1/K=2/V={"\t"," $",0,0}/L={0,0,119,0,1} <path & file spec>

should get the header. And something like:

LoadWave/J/D/E=1/K=0/V={"\t"," $",0,0}/L={0,120,0,0,3} <path & file spec>

should get the data.

Note the difference in the /L flag. In the first instance you read 119 lines starting from line 0. And in the second, you start at line 120 and read until no more data is found, that is you let Igor determine where the end of the data lies.

I seldom use loadwave; I am not an expert. Others may have better ideas. The two LoadWave commands shown above were obtained by setting up the operation using the LoadWave dialog from the Data menu.