Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 Excel Spreadsheets into one 2

Status
Not open for further replies.

tk94kato

MIS
Oct 22, 2005
5
US
Referencing my other post, I can now read in multiple files but I cannot figure out how to write to a page that already exists. I get an error message when I try to write to a worksheet that I created earlier.

i create sheet 1 from file 1
i create sheet 2 from file 2
i want to add to sheet 1 from file 2<<< this is my question to the pros here.
 
Create a new excel file.

The Excel perl modules that I've used deal entirely with either reading (parsing) a file, or writing to a file. They do not to both, and they definitely do not do editing.

You could view this as a limitation that is pretty annoying, but in truth, it can be easily gotten around. Basically, you simply create a new spreadsheet whenever you want to make changes like you are describin. Instead of adding one worksheet to another, create a third in which you add both worksheets. Then, delete the original file and rename the newly created one.
 
Have a look to:
thread219-824783
It might be interesting

dmazzini
GSM System and Telecomm Consultant

 
I may be driving myself crazy with this. I can't seem to make anything work. My goal is to combine about 20 or so spreadsheets into one monthly report. Each daily report only has a few items but the combined report will end up with over 50 sheets and numerous rows. I am just learning perl and I am at a complete loss. I am really good at adapting code for my own programs but I cannot seem to find an example program for this. Any ideas?
 
If I understand the problem, the basic flow of what you're looking to do is:

[ol]
[li]scan through a directory of spreadsheets[/li]
[li]parse out the contents of each of them[/li]
[li]insert each parsed file into a sheet of a new spreadsheet[/li]
[/ol]

This should be fairly easy to accomplish using the readdir command in conjunction with a foreach loop or subroutine to do the processing. If you can write to one sheet using the WriteExcel module, making that a reusable object shouldn't be too much of an exercise.

- George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top