Computing.Net > Forums > Unix > removing new lines from a file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

removing new lines from a file

Reply to Message Icon

Name: hernandez
Date: December 4, 2003 at 04:52:47 Pacific
OS: xp / korn shell
CPU/Ram: 196
Comment:

Hi,

I have a massive datafile - 1,000,000+ characters. I want to remove all the new lines from it so the data is one continuos flow.
I tried xargs but it complains of exceeding 2048 characters.
Can anyone help?

thanks



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: December 4, 2003 at 05:44:47 Pacific
Reply:

Have you tried "tr". You can either change the newline character to something else, like a space or delete.

tr -d '\n'


0

Response Number 2
Name: hernandez
Date: December 4, 2003 at 06:25:45 Pacific
Reply:

awesome - works a treat
thanks


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: removing new lines from a file

Remove blank lines from file www.computing.net/answers/unix/remove-blank-lines-from-file/3887.html

Get the first line from a file www.computing.net/answers/unix/get-the-first-line-from-a-file/7981.html

Script to Remove lines from a file www.computing.net/answers/unix/script-to-remove-lines-from-a-file/5268.html