in reply to break up file with no line breaks
Try this, it'll take around 10 seconds:
perl -ple"BEGIN{ $/ = \80 }" theBigFile > theNewFile
If you only want to break lines after a comma, then it's a tad more complicated:
(Note:one-liner wrapped for posting!)
perl -e"BEGIN{$/=\80}" -nle"$x.=$_; print $1 while length($x)>80 and $x=~s[(.{1,80},)(?!,)][] +" theBigFile > theNewFile
|
|---|