Read a CSV file with roboguide

  • It is possible with KAREL. For example you could read a file from the FR or UD1 drive.

    You would use the READ command to get the values from the file and the SET_POS_REG command to set position register values.

    There is no built-in support for parsing CSV files. The behavior of READ is a little tricky. It depends on the data type of the variable that you pass it. For example, if you use READ and use an INTEGER data type it will consume white space until it finds a number and then read until it hits whitespace (or maybe a non-number character). But if you use READ with a STRING data type it will read to end of line. I have found it easier to use space delimited files when dealing with numbers because of the behavior of the READ command.

Advertising from our partners