Reply To: Global Variable by file

Product Compare Forums Multi-Edit Support Global Variable by file Reply To: Global Variable by file

#5155
deleyd
Participant

Not sure if I understand the problem but sounds like you want to parse the first few lines of a text file. You can use TOF; to position to the top of the file, then GET_LINE to get the current line, then XPOS to search the current line for keywords. Then DOWN; to move to the next line. So something like:

[code:113ve61f]TOF;
XPOS("Workorder",GET_LINE,1);[/code:113ve61f]

You could parse the current line to see if it begins with a date of the format dd-dd-dd using FIND_TEXT (I’m not expert at UNIX regular expressions but I’ll give it a try here)

[code:113ve61f]IF ( FIND_TEXT("^[0-9]-[0-9]-[0-9]",1,_RegExp) ) {[/code:113ve61f]

So hopefully these are some ideas.