in reply to Splitting long file

This is untested, but should be close

perl -044ne"($n,$d)=m[\n?([^\n]+)\n(.+)\$?]m;open O,'>$n';print O $d;c +lose O;" file

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail

Replies are listed 'Best First'.
Re: Re: Splitting long file
by davis (Vicar) on Apr 08, 2004 at 10:43 UTC

    This seems closer. (NB: Win32 quotes switch to *nix-style)

    perl -044ne '($n,$d)=m!\n?([^\n]+)\n([^\$]+)!s;open O,">$n";print O $d +' file
    Update: 044 removed from command line
    D'oh.


    davis
    It's not easy to juggle a pregnant wife and a troubled child, but somehow I managed to fit in eight hours of TV a day.