Read file in karel

  • Hello,

    I am trying to karel to read file line by line.and store it in string Var then I will do some data validation.


    To be more specific I need to understand how to use READ Statement and how can I read line by line.


    So please if you have an example about this situation.


    Thanks,

    Moelsayed

  • AD
  • There is an example of using READ in the KAREL manual in the section File Input/Output Operations. Please post the code you have so far. READ is a little tricky if you mix numbers and string on the same line. When possible I put one data item per line to simplify the reading.

  • But I haven't seen any mention of JSON in the KAREL manual. Are there JSON read/write functions in KAREL?

    I don't think so? I was just making a joke about what you said about it being tricky to mix numbers and strings in the same line -- JSON doesn't generally allow line breaks within an element, so separating your numeric and non-numeric data onto separate lines would be an issue.

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