Reading a specific line from a text file 
Author Message
 Reading a specific line from a text file

Anybody

I have opened a basic text file for reading using the 'Open for Input As'
command.  If, for example, I wish to read a specific line i.e. 10th, how do
I achieve this without reading all subsequent lines?

Thanks
Ian Hinde



Fri, 15 Nov 2002 03:00:00 GMT  
 Reading a specific line from a text file
Use a counter variable and simply ignore all input until you reach the
desired line. As an alternative, you can add a reference to the Microsoft
Scripting Runtime and open your file as a TextStream. TextStream objects
have a SkipLine method that does what you want.

--
eXtending the power of AutoCAD
http://www.acadx.com


Quote:
> Anybody

> I have opened a basic text file for reading using the 'Open for Input As'
> command.  If, for example, I wish to read a specific line i.e. 10th, how
do
> I achieve this without reading all subsequent lines?

> Thanks
> Ian Hinde



Fri, 15 Nov 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Reading specific line of file

2. Reading Line by Line through Text File

3. Reading a Specific Line in a file

4. Reading text file line by line

5. Reference/Pointer to a specific line in a text file

6. How to read partial text in a line of a text file

7. write to a specific line in a text file

8. QBasic: Reading specific data from a text file?

9. Read from Specific String and write to Text File

10. getting a specific line of text from a text box (vb5)

11. Read lines (with commas) from a text file

12. Problem reading in text file line

 

 
Powered by phpBB® Forum Software