Search code examples
labview

How to call one line at a time in LabVIEW read text file?


I would like to read just one line of text at a time using "Read from text file" function. After the passing of this line I would like to move on to the next line after the rest of the program iterates once. When I change the "Read from text file" function to "Read lines", I can no longer put an indicator on the front panel for text. How can I iterate one line at a time? How can I put an indicator on the front panel to display which line of text was read?


Solution

  • This what you want:

    1. Open/Create/Replace File (with inputs open and read-only) — inside While Loop:
    2. Read From Text File (with Read Lines)
    3. End While Loop on error from Read From Text File --After While Loop:
    4. Close File

    You can process the data in the While loop, or index it and process outside.

    Process text file one line at a time