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!

Reading two lines at a time

Status
Not open for further replies.
May 31, 2007
31
0
0
AE
Hi All,

I have a text file which has line item entries. Each line item has two lines per item. What i am trying to achieve is to put the two lines of text onto a single line. After which I plan to create a Csv file.

Whats the best way to read two lines at a time.

thanks in advance.
 
>Whats the best way to read two lines at a time.
So we can suppose you know the _best_ way to read one line at a time. Suppose the second best method to read a line is:
[tt] s=f.readline[/tt]
where f is the textstream object. The second _best_ method to read two lines at a time is this.
[tt] s=f.readline
if not f.atendofstream then
s=s & "." & f.readline 'separator assume be a comma; it can be anything
end if[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top