I loop a txt file line by line with the tipical:
File = FreeFile
Open "C:\TEMP\TABULATI_132.TXT" For Input As File
While Not EOF(File)
Line Input #File, strFileLine
....
wend
and check string with INSTR but i'm sure not is a very good Fasetd method....
Pearph i need the MID statement ineatsted?
note:
in my txt file are presents many blank line and i skip with the ...if len ...>0 then
my txt file in the simple case can have approx 300.000 or 400.000 lines
Wath is really fast mid or instr
-
- PlatinumLounger
- Posts: 4473
- Joined: 26 Apr 2010, 17:36
Wath is really fast mid or instr
Last edited by sal21 on 24 Mar 2011, 23:36, edited 1 time in total.
-
- Administrator
- Posts: 79317
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- PlatinumLounger
- Posts: 4473
- Joined: 26 Apr 2010, 17:36
Re: Wath is really fast mid or instr
leght of string chek, type numbers or lketters or wath?HansV wrote:It depends on what you want to check...
haaaaaaaa... i write the result in a acess database with
rs.addnew
...
rs.update
-
- Administrator
- Posts: 79317
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Wath is really fast mid or instr
If you want to extract text from a specific position in the line, it's best to use Mid.
If you want to test whether a specific text string occurs in the line, it's best to use InStr.
If you want to test whether a specific text string occurs in the line, it's best to use InStr.
Best wishes,
Hans
Hans