08-10-2017 03:15 AM
Hello All,
Assume I have a text File with Two Lines (Future it may be More) so i am using Read from Text File with Read Lines Enabled, and the Number of Lines to read is exact as my Content inside the File (2 as of now), then the Read from Text File Gives me Error 4 End of Line Encountered. whether this response is valid?
Though it tells that it has encountered the end of line but it still gives me a false information as i am reading Line numbers as same as content in the file.
The Error is more Valid when i am giving the number of lines beyond the content in the file
If anyone has difference in opinion please comment.
08-10-2017 03:19 AM
That error is End Of FILE reached. You did read to the end of the file, so it is valid. I just clear that specific error and move on. If in a loop, I can use the "error cleared" output to stop the loop.
08-10-2017 03:24 AM - edited 08-10-2017 03:26 AM
Hi Palanivel,
Assume I have a text File with Two Lines (Future it may be More) so i am using Read from Text File with Read Lines Enabled, and the Number of Lines to read is exact as my Content inside the File (2 as of now), then the Read from Text File Gives me Error 4 End of Line Encountered. whether this response is valid?
When trying to recreate your problem I fail (somehow)…
- I create a text file with two lines by opening Notepad and pressing the Enter key two times, then save this text file.
- I load this text file using ReadText, set to "read lines" mode, and have it read two lines: it's working as expected WITHOUT giving an error!
- When I try to read three lines from this file I get error 4 - as expected: I only created two lines in the file…
So can you provide an example which shows your problem to read two lines from a file containing (atleast) two lines of text?
08-10-2017 03:39 AM
Hi GerdW
@GerdW wrote:
When trying to recreate your problem I fail (somehow)…
- I create a text file with two lines by opening Notepad and pressing the Enter key two times, then save this text file.
Hope you are giving Enter Key two Times which will create extra Line (3 Lines), so try to give a Single enter key between two lines.
I have shared the sample File which i have used.
08-10-2017 03:46 AM
Hi Crossrulz
It can be a warning and should not be a error ( Error can be Provided when my input is greater than the Number of Lines in the Files),
Error can be Cleared but still it gives me false information.
08-10-2017 03:49 AM - edited 08-10-2017 03:52 AM
Hi Palanivel,
your file only contains one line - and a partial line without proper EOL chars: "TEst\r\npalani"…
When you want ReadText to detect full lines you need to provide EOL chars for each line!
Hope you are giving Enter Key two Times which will create extra Line (3 Lines)
No, the Enter key creates EOL chars (CR+LF in Notepad) and so ends the line.
The cursor moves to the next line, but this next line is still empty…
08-10-2017 03:52 AM
Hi GerdW
Thanks for the update, Just Found Write to Text File with Array Input Provides Enter Key at the end of file.