View Single Post

  #4 (permalink)  
Old 05-14-2008, 12:56 AM
nixcraft's Avatar
nixcraft nixcraft is offline
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 910
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Try following shell script
Code:
#!/bin/bash
INPUT="/path/to/file"
while read line
 do
 echo -n $line
done < $INPUT
You can also try tr
Code:
tr -d '\n\' < /path/to/file
Perl version
Code:
perl -e 'while (<>) { if (! /\|$/ ) { chomp; } print ;}' </path/to/input/file
GNU sed version (may not work with UNIX / BSD sed):
Code:
sed ':a;N;$!ba;s/\n//g' < /path/to/file
Use any one of the above method
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool

Last edited by nixcraft; 05-14-2008 at 01:05 AM.
Reply With Quote