I want to stop a while condition when I read a EOF of text file 
Author Message
 I want to stop a while condition when I read a EOF of text file

Read Lines From File.vi on the File I/O palette is an example for how
this is done. In fact, you might just want to use this VI instead of
your own if the file has a large number of lines. As the comment at
the bottom of the VI states, using the string contatentation is not
very effecient for more than a few lines.


Fri, 12 Nov 2004 22:55:37 GMT  
 I want to stop a while condition when I read a EOF of text file
Thank's Rob for your answer
but, I don't want read antire file.
I want to:
-Open file
-Read one String
-Analysing the String
-Test if Eof
-Read one String
-Analysing the String
-Test if Eof .....etc
-If Eof is True then closed file

Thank's



Sat, 13 Nov 2004 14:24:50 GMT  
 I want to stop a while condition when I read a EOF of text file
Hallo

I ran into the same problem several times.
It's just the way a while loop works. It's annoying but...
If I read into an array with autoindexing I keep a count of how many
reads I did and delete the last entry. Or you'll have to insert a
if-case inside the loop and process only if there was no EOF.

Using the high level routines in loop is certainly no way.
Open-read-close-open-read-close-open-read..... is a certain
performance killer.

Gabi



Sat, 13 Nov 2004 20:28:59 GMT  
 I want to stop a while condition when I read a EOF of text file
Thank's
But I can't read One line-->analyse the string-->test the Eof-->read
One line--> etc...
If you have the solution!!!
Thank's


Sat, 13 Nov 2004 22:22:44 GMT  
 I want to stop a while condition when I read a EOF of text file
If you read line by line you can't know if this is last line because
labview don't put the EOF symbol to data. Last symbol always is Line
Feed. In vi that i attached i compare each symbol with empty string,
because only this way you can know if you reached EOF.


Sat, 13 Nov 2004 22:55:33 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. I want to stop a while condition when I read a EOF of text file

2. EOF condition in (read) from file

3. eof fails when reading encrypted data in text file

4. eof for text file

5. Ascii Text file, eof marker

6. Q: EoF marker and reading file

7. file.read(num) returns empty string before EOF.

8. HOW READ A FILE UNTIL EOF ???

9. Help with binary files, read, and eof

10. Problem reading data from a file (encounter EOF after second last record)

11. A good idiom for EOF when READing files?

12. Help with MF Cobol/Unix/EOF Condition

 

 
Powered by phpBB® Forum Software