473,503 Members | 1,685 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Search inside a text file, Visual Basic

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
1 5799
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
5766
by: mm | last post by:
Can someone with Win 2K please help me here. Best yet, can some MVP duplicate it and report it to MS. I can't find any reference to this issue on the Web, or in MS Knowledge Base. I have been...
60
48977
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't...
0
1541
by: Sushil Srivastava | last post by:
Hi Guys, I have developed a utility that provide a smart MSDN knowledge base search both off-line and on-line. I have describe more in detail below why I decided to write this utility (one...
3
3791
by: Bre-x | last post by:
Hi, I have a text file that is made of a number of paragraphs: each paragraph start with either: ":O", ":N", or ":" follow by a 4 digit number and finish with either: M30 or M99 What I need...
5
4820
by: Stewart Saathoff | last post by:
Hello, I am trying to search the file system from a string of text located inside of a textbox on a form and have it return a list of file names in a list box on that same form. Does anyone...
2
1787
by: Darko | last post by:
I have a Microsoft (R) Visio (TM) document, which contains a link inside (eg. to "http://blabla/"). When I do a full-text search from within Windows Explorer, searching for "blabla", it finds that...
3
1743
by: pa2ratczi | last post by:
hi folks, just want to ask some procedure in terms of searching files with visual basic. The program i want to make id that i want to be able to search file by just entering a file name in a text...
11
2261
by: RivaCom | last post by:
I am using a Access Database to search/add a bunch of information in MS VB.net 2005 express. In the query (querybuilder) everything seems right, but in the WHERE statement I use = me.textbox.text...
0
10706
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.