Regarding 2 excel files merging

sriv's Avatar, Join Date: Dec 2007
Light Poster
Hi i am using the following code to display the .XLS file

if i want to display the content from 2 .XLS files in a single output file then what should i do
can any one please help?
in the below code if i want to display the conetent from both $FILE and $FILE2 then how?
------------------------------ code ----------------------------------------
print "Content-Type: application/\n\n";
	if(-e "/tmp/$FILE") {
		open(XLS, "/tmp/$FILE") || die("Error: $FILE no longer exists!");
		while(<XLS>) {
			print $_;
		close XLS;

		unlink("/tmp/$FILE") if(-e "/tmp/$FILE");


Last edited by shabbir; 9Jan2008 at 14:05.. Reason: Code block
pradeep's Avatar, Join Date: Apr 2005
Team Leader
XLS or spreadsheet files are binary files, which you cannot merge together like text files. You'll need to use some spreadsheet module to first read the two XLS files and again recreate the merged data!
sriv's Avatar, Join Date: Dec 2007
Light Poster
thanks pradeep.
is there any other way by using UNIX commands in the server to merge two XLS files?so that we can use 'system()' function to execute that unix command in perl script.

actually what happened is i am using Spreadsheet module for showing the data from databse in excel sheet in a formated way.
it is working for for rows less than 30000 from database .... if the rows are greater than 30000 then creating empty excel sheet.
so i have written a programme like splitting the records in to number of XLS files when the data is more than 30000 rows...
so now i need to show these files data as single output file data to the user.

can u please suggest how can i do this?
XXxxImmortalxxXX's Avatar
Invasive contributor
what the **** bann this bitch this guy is pissing me off gprunescape22
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
He tried to spam and could not and so was testing with some good posts as to why my spams are not getting displayed.
go4417's Avatar, Join Date: Sep 2009
Newbie Member
There is software that can handle this merge. We use Excel File Merger to vertically append 439 .xls files into one master file. The windows version of the app is called Bulk File Merger.

The program will also merge doc files, merge pdf files, even txt and csv files.