Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sed'ing out newlines



On Mon, Dec 15, 2003 at 12:49:34PM -0500, Dan Barrett wrote:
> Folks,
> Can anyone remind me of the proper regexp to feed sed which will cause it to 
> eat newlines off?  I've got a file of newline-separated data which I want to 
> concatenate into one big string.

Is that all you want to do, or are you doing something else in your sed
script? I ask because I think it'll be expensive and slow (I haven't
used sed in awhile, but I think you'll end up having to load the entire
file into its memory). The "tr" utility can remove newlines much more
efficiently:

  tr -d '\012' <infile >outfile

Nathan


> 
> d.
> 
> _______________________________________________
> Discuss mailing list
> Discuss at blu.org
> http://www.blu.org/mailman/listinfo/discuss
> 
> 

-- 




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org