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

removing new lines from a file

Reply to Message Icon

Original Message
Name: hernandez
Date: December 4, 2003 at 04:52:47 Pacific
Subject: removing new lines from a file
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


Report Offensive Message For Removal


Response Number 1
Name: David Perry
Date: December 4, 2003 at 05:44:47 Pacific
Subject: removing new lines from a file
Reply: (edit)

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

tr -d '\n'


Report Offensive Follow Up For Removal

Response Number 2
Name: hernandez
Date: December 4, 2003 at 06:25:45 Pacific
Subject: removing new lines from a file
Reply: (edit)

awesome - works a treat
thanks


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: removing new lines from a file

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software