1,105,594 Community Members

read file

Member Avatar
guest3
Light Poster
42 posts since Jan 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I have a text file with one of the lines as : name=AB,CD,EF
I read the line like this:

input# line,str

first str is name=AB then the next line is CD and then EF, why it does not read the whole line at once.

Member Avatar
rishif2
Posting Whiz in Training
284 posts since Dec 2012
Reputation Points: 57 [?]
Q&As Helped to Solve: 58 [?]
Skill Endorsements: 4 [?]
 
0
 

use Line Input # instead of Input # if you wanna read an entire line .

input # reads line upto , .

hope this helps you . . .

Member Avatar
guest3
Light Poster
42 posts since Jan 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

what do you mean by use Line Input # instead of Input #. can show me the actual syntax?.

Member Avatar
rishif2
Posting Whiz in Training
284 posts since Dec 2012
Reputation Points: 57 [?]
Q&As Helped to Solve: 58 [?]
Skill Endorsements: 4 [?]
 
0
 

lets have a look at following :-

Dim xno As Integer
Dim xtext As String
Open "d:\file.txt" For Input As #xno
Line Input #xno, xtext  'this is the actual line for what you searching
Print xtext

hope this helps you . . .(if it really helps then mark this thread as solved)

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article