Search inside a text file, Visual Basic

  • Thread starter Thread starter All
  • Start date Start date
A

All

Hi
I have a bunch of text files which need to be organized.
What I want to do is to select three continuous lines from
each text file and write them down in another text file.
Each of those three line is started with character such
as "IH".
There are also more lines repeated after these three lines
which are started with the same character, but I do not
want to take them.

Please let me know how I can write a function in VB that
does that.

Thanks
Regards
All
 
Hello,

All said:
I have a bunch of text files which need to be organized.
What I want to do is to select three continuous lines from
each text file and write them down in another text file.
Each of those three line is started with character such
as "IH".
There are also more lines repeated after these three lines
which are started with the same character, but I do not
want to take them.

Have a look at the classes 'StreamReader' and 'StreamWriter' in the
'System.IO' namespace. You can use the 'StreamReader''s 'ReadLine' method
to read a line from the file.

Regards,
Herfried K. Wagner
 
Back
Top