The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Multiple Files deletion in perl pulkit Shell Programming and Scripting 1 02-12-2008 02:55 AM
Perl program to read from multiple files jyotipg Shell Programming and Scripting 1 07-19-2006 06:26 PM
Combining multiple lines DUST Shell Programming and Scripting 4 07-15-2005 07:57 AM
Perl - Emailing MULTIPLE files as attachment Tonka52 Shell Programming and Scripting 3 02-11-2004 10:19 AM
Adding 3 Lines to Multiple c and h files with perl Lazzar Shell Programming and Scripting 2 10-28-2003 10:30 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-17-2005
Registered User
 

Join Date: Sep 2004
Location: Mumbai-India
Posts: 156
Combining Multiple files in one in a perl script

All,

I want to combine multiple files in one file.

Something like what we do on the commad line as follows ->

cat file1 file2 file3 > Main_File.

Can something like this be done in a perl script very efficiently?

Thanks,
Rahul.
Reply With Quote
Forum Sponsor
  #2  
Old 12-17-2005
Registered User
 

Join Date: Mar 2005
Location: Hyderabad, India
Posts: 22
If the OS is *nix, the easiest way I think is to call the same command from inside perl script.

print `cat file1 file2 file3 > Main_File`;

Otherwise read the file in array and write them to one file.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:03 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0