Solved

read specific line in  a text file

Posted on 2008-06-23
2
430 Views
Last Modified: 2008-06-23
How can I read a specific line and a text file. for example, I want to get a data from a text line just on line number 25. This contains probably about 60 to 70 lines.
0
Comment
Question by:VBdotnet2005
2 Comments
 
LVL 13

Accepted Solution

by:
iHadi earned 125 total points
ID: 21851229
Hi

Try the following code:

Dim str() as string = File.ReadAllLines("C:\\a.txt")
Console.WriteLine(str(24))
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 21851390
Code above assume you have this at the top:

Imports System.IO
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question