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

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

  • Thats a good question. In the RMI brochure from Fanuc it mentions sending JSON string packets between PC and robot. But I haven't seen any mention of JSON in the KAREL manual. Are there JSON read/write functions in KAREL?

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

Advertising from our partners