Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I read an entire line of text in VisualBasic

Status
Not open for further replies.

seba18

Programmer
Jul 26, 2004
38
0
0
I don't know how to read from a file an entire line of text with VB.If I use Input #, it stops to the first "," from the text.
 
NO, you don't understand...

For example, if i have a text file with this content:

qwerty,asdf

and I use Input #1,s then s="qwerty", but I want to read a whole line of text (s="qwerty,asdf")

Anybody know how can I do that?
 
Use this code or similar
Code:
Line Input #1, s
to achieve what you want to do .

Note this uses Line Input and not simply Input[/]


Dave
 
Line Input #FileNo1, string/variable

#FileNo1 is for an input file(i think!!), so u may not need this.

To find a specific sub string in a bigger string, try:

substring = Mid(biggerString, 110, 6)

hope it helps,

the Punisher
 
the 110 refers to the specific coulmn you want to start looking for the string.

the 6 means it is 6 characters long.
 
Line Input is just what JohnYingling's first answer gave you!

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Quite so! [smile]

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top