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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove preceding newline 1

Status
Not open for further replies.

mte0910

Programmer
Apr 20, 2005
232
US
Not sure where to even start, but here goes:

Input data:
This is a complete sentence.
This is
also a
complete sentence.
This is a complete sentence.
this is also a
complete sentence.

Output data:
This is a complete sentence.
This is also a complete sentence.
This is a complete sentence.
This is also a complete sentence.

I have newline characters breaking up my data that I need to remove; however, I can only identify them by looking at the begining of the line, so I need to remove the preceding newline character under those conditions.

I hope this makes sense?
 
Code:
I can only identify them by looking at the begining of the line
Not sure I understand that statement but 'chomp' is the function you are looking for. I assume you are reading the data in line by line in a loop of some sort.
If you chomp them all out, you would need to put the newlines back in where appropriate

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top