Solved

read specific line in  a text file

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Web Form VB.Net  import CSV 4 43
Write to file when application closes (by logoff) - VB.NET 1 37
Vb.net threads keep increasing 2 34
VB.NET Textbox input validation 4 37
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

766 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