I use the tipical:
Open "C:\TEMP\TABULATI_132.TXT" For Input As #1
ecc....
instead to read to the top > to the bottom i need to read from the botton to the top, possible?
READ text file from the botton to the top..
-
- PlatinumLounger
- Posts: 4365
- Joined: 26 Apr 2010, 17:36
-
- Administrator
- Posts: 78578
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: READ text file from the botton to the top..
Turn the monitor upside down?
But seriously, the methods for reading a text file are optimized for reading forwards i.e. top to bottom.
You might read the lines into an array of strings, then loop backwards through the array.
But seriously, the methods for reading a text file are optimized for reading forwards i.e. top to bottom.
You might read the lines into an array of strings, then loop backwards through the array.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4365
- Joined: 26 Apr 2010, 17:36
Re: READ text file from the botton to the top..
AHHHHHHHHHHHHHHH.... sure!HansV wrote:Turn the monitor upside down?
But seriously, the methods for reading a text file are optimized for reading forwards i.e. top to bottom.
You might read the lines into an array of strings, then loop backwards through the array.
i ordering the filled array backwards when the code finish the regular reading?
-
- Administrator
- Posts: 78578
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: READ text file from the botton to the top..
You don't have to order the array but you can read it backwards:
Code: Select all
Dim i As Long
For i = UBound(MyArray) To LBound(MyArray) Step -1
' process MyArray(i)
Next i
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4365
- Joined: 26 Apr 2010, 17:36
Re: READ text file from the botton to the top..
I'M VERY STUPID!HansV wrote:You don't have to order the array but you can read it backwards:
Code: Select all
Dim i As Long For i = UBound(MyArray) To LBound(MyArray) Step -1 ' process MyArray(i) Next i
Naturally the step -1 is wath i need!
tks!