By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,818 Members | 1,381 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,818 IT Pros & Developers. It's quick & easy.

Search inside a text file, Visual Basic

P: n/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

Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hello,

"All" <ar*@coe.neu.edu> schrieb:
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
--
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.