Computing.Net > Forums > Unix > Split a file into 2 files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Split a file into 2 files

Reply to Message Icon

Name: Bava
Date: January 22, 2007 at 20:15:17 Pacific
OS: UNIX
CPU/Ram: 64-bit
Product: Sun Solaris
Comment:

Hi,

I am trying to split a file which has fixed 10 rows into two files in PERL. The first 5 rows into fileA and the last five rows into fileB. I have to do this in a loop because I have multiple files to split daily. I am new in Perl. Can someone help urgently.
Thank you.

Rgds, Bava



Sponsored Link
Ads by Google

Response Number 1
Name: Bava
Date: January 22, 2007 at 22:36:15 Pacific
Reply:

Hi again,

Any script will do, sed, awk, shell, perl etc.. to solve the mentioned problem
Thanks.

Rgds, Bava


0

Response Number 2
Name: nails
Date: January 24, 2007 at 07:31:23 Pacific
Reply:

Take a look at the Unix split command:

man split


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Split a file into 2 files

split a file with headers and trail www.computing.net/answers/unix/split-a-file-with-headers-and-trail/8235.html

Split a Text file using blank line www.computing.net/answers/unix/split-a-text-file-using-blank-line/7501.html

to split a file www.computing.net/answers/unix/to-split-a-file/5481.html