Solved

read specific line in  a text file

Posted on 2008-06-23
2
432 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sql server insert 13 44
VB.net and sql server 4 53
ASP.NET (VB) return a record 2 51
Retrieve Active Directory Groups a User belongs to in VB.NET 3 41
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

685 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