Loading multiple waves with different firstline values

Hi. I have a function that loads in waves from multiple text files using LoadWave. Most of the files have a header of a set length so I use the /L flag and set the location of the first line of data. However in a few of the files, the header is a couple of lines longer, this causes LoadWave to start loading the header itself instead of the desired data. The end of the header has a clear deliminator, Is there any way to read the line location of this delimitation so I can make the "first line" variable?

Thanks!
In case the automatic detection does not work, the /L flag should do the job. Just parse your file for the end of header delimiter (using FReadLine), count the lines and hand it to the /L flag as a parameter.
HJ
HJDrescher wrote:
In case the automatic detection does not work, the /L flag should do the job. Just parse your file for the end of header delimiter (using FReadLine), count the lines and hand it to the /L flag as a parameter.
HJ


Thanks, I ended up going with your suggestion and writing a little function to find the start line for the L flag.
Function EndofheaderLoc(path)
    string path
    variable refn,i
    string readstring
        i=0
    open/r refn path
    do
        FReadline refn ,  readstring
        i+=1
    while (strsearch (readstring, "*HeaderEnd*",0,2)<0)
    return i   
end
also easy with grep:

Function EndofheaderLoc(path)
    string path
   
    Grep /Q/E="\*HeaderEnd\*"/Z path
    return V_startParagraph
end

thomas_braun wrote:
@tony: You are missing the dot before the star in the regexp.


Oops, actually, I forgot to escape the asterisks in the regexp. The asterisks were part of the end-of-header mark in the example given. Edited to correct. Thanks, Thomas.