Well, based on the sample snippet, there's was a line break just before each date, right? You could try
perl -pi.bak -e 's/ *(?:\d{4}-\d{2}-\d{2})/\r\n/g' filename
That inserts CRLF before the date at all instances and saves the original to filename.bak - see perlrun.
update: Oops, typo. I mean
perl -pi.bak -e 's/ *(?=\d{4}-\d{2}-\d{2})/\r\n/g' filename
Thanks, johngg!
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re: splitting cvs file without line breaks
by shmem
in thread splitting cvs file without line breaks
by rendier
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |