Read a CSV file with roboguide

  • AD
  • 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now