RobotStudio event

Parsing a multi line txt file

Options
I currently have a system that is reading offsets from a txt file stored in the robot home folder. Basically a csv file copied into a .txt file. The current way of reading it, is using  the command below. 

stPart:=ReadStr(datafileRd\Delim:="\09"\RemoveCR\DiscardHeaders);

Each line of txt consists of 60 Tab separated values which the current way of reading means its it reads all 60 values before it reads the next line.

What i am needing to do is after reading the first value on the line, if the value is not equal to the number i am looking for then drop down to the first value of the next line. i would keep dropping down the first value of each line till the value is = to number i am looking for, to which i can then use my existing code to read all the offsets of that line.

What would be the ReadStr command to line feed down as apposed to the above TAB delimeter.
 
This will reduce processing time of obtaining offsets from some very large txt files 



Tagged:

Comments

  • lemster68
    lemster68 ✭✭✭
    Options
    I don't know of any way to "fast forward" the reading of a file, sorry.  What if you split each off into its own file?
    Lee Justice
  • garlo82
    Options
    We have over 250 lines split over about ten files. This could be an option though. In reality it seems so simple and something easily done in the likes of VBA etc but cant seem to "search down the columns before reading across the line" 
  • Micky
    Micky ✭✭✭
    Options
    Hello,
    the function ReadStr provides the parameter "Line" which specifies which line in the file should be read

    ReadStr (IODevice [\Delim] [\RemoveCR] [\DiscardHeaders] [\Time] [\Line])

    Maybe this parameter can help to solve your problem.