Wednesday, August 10, 2005

Limits of sed

Well a user had a huge ascii file 1.5 gigs and all of that on a single line.Wow!

So the job was to make it a span many lines,by putting a newline after every 310 characters.

So the suggested sed expression was:

$sed 's/\(.\{310\}\)/\1\n/' filename


But it appears that sed crapped out with following error:

sed: Couldn't re-allocate memory


Maybe something like C is better suited for this as sed is basically a line editor,so maybe tries to read and operate on it in a single go :).

0 Comments:

Post a Comment

<< Home