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

Split a file into 2 files

Reply to Message Icon

Original Message
Name: Bava
Date: January 22, 2007 at 20:15:17 Pacific
Subject: Split a file into 2 files
OS: UNIX
CPU/Ram: 64-bit
Model/Manufacturer: 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


Report Offensive Message For Removal


Response Number 1
Name: Bava
Date: January 22, 2007 at 22:36:15 Pacific
Subject: Split a file into 2 files
Reply: (edit)

Hi again,

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

Rgds, Bava


Report Offensive Follow Up For Removal

Response Number 2
Name: nails
Date: January 24, 2007 at 07:31:23 Pacific
Subject: Split a file into 2 files
Reply: (edit)

Take a look at the Unix split command:

man split


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Split a file into 2 files

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge