Re: split file
- From: "John W. Krahn" <someone@xxxxxxxxxxx>
- Date: Sat, 29 Dec 2007 06:37:27 GMT
Babu wrote:
I am new to perl.I have basic question about splitting a file into 2.
the input file= temp.hex
contents
4A
5F
C3
3D
is there a one liner to split this file into 2 files temp1.hex
containing
4A
5F
and temp2.hex having
C3
3D
perl -e'$h = ( @x = <> ) / 2 + .5; open _ and print _ splice @x, 0, $h for map ">$_", qw/temp1.hex temp2.hex/'
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
.
- References:
- split file
- From: Babu
- split file
- Prev by Date: Re: split file
- Next by Date: FAQ 5.24 How do I get a file's timestamp in perl?
- Previous by thread: Re: split file
- Next by thread: FAQ 5.24 How do I get a file's timestamp in perl?
- Index(es):
Relevant Pages
|