in reply to break up file with no line breaks
use Text::Wrap qw( wrap ); local $Text::Wrap::columns = 80; print wrap('', '', <IN>);
Update: I misunderstood the question and missed the magnitude of the file!
use Text::Wrap qw( wrap ); local $Text::Wrap::columns = 80; local $Text::Wrap::break = qr/(?<=,)/; local $/ = ','; print wrap('', '', $_) while <IN>;
Downside: Will break on every comma, even those in the middle of a field.
You can get rid of the Text::Wrap entirely if none of the fields are overly large.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: break up file with no line breaks
by BrowserUk (Patriarch) on Apr 22, 2009 at 03:10 UTC | |
by ikegami (Patriarch) on Apr 22, 2009 at 03:24 UTC |