# \[VB\] Read a specific line from txt file

**URL:** <https://forum.kirupa.com/t/vb-read-a-specific-line-from-txt-file/187883>\
**Category:** random\
**Created:** [May 3, 2006, 12:10am UTC](https://forum.kirupa.com/t/vb-read-a-specific-line-from-txt-file/187883 "2006-05-03T00:10:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unchew](https://avatars.discourse-cdn.com/v4/letter/u/7ba0ec/32.png) [@unchew](https://forum.kirupa.com/u/unchew)\
**Post date:** [May 3, 2006, 12:10am UTC](https://forum.kirupa.com/t/vb-read-a-specific-line-from-txt-file/187883/1 "2006-05-03T00:10:21Z")

</div>

I am trying to import some text from a .txt file and then be able to retrieve specific lines as strings. I have managed to open the text file using a StreamReader Object and thats it. I have no idea how to tell VB to extract certain lines I want. Any idea how this is done?

Here is my code at present:

```auto
[SIZE=2][COLOR=#0000ff]
Dim[/COLOR][/SIZE][SIZE=2] oStreamRead [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] IO.StreamReader
oStreamRead = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] IO.StreamReader(Application.StartupPath + [/SIZE][SIZE=2][COLOR=#800000]"\espanol.txt"[/COLOR][/SIZE][SIZE=2])
[/SIZE]

```

I really need this done, please help.

Thanks.
