Re: Merging 2 xlsx files
by thanos1983 (Parson) on Sep 07, 2017 at 08:08 UTC
|
Hello mnakkach,
Welcome to the Monastery. This question actually has been asked again and contains sample(s) of code that will do exactly what you want.
Take a look here, writing after parsing and also here Spreadsheet::WriteExcel; combining xls into one.
If you still have some problems with the code, give us sample of input, output and code that is compiling and we will try to assist you more.
Hope this helps, BR.
Seeking for Perl wisdom...on the process of learning...not there...yet!
| [reply] [d/l] [select] |
|
|
| [reply] |
|
|
Hello again mnakkach,
What you have done so far? How you are approaching your problem? The code is not so complicated, try to read line by line, debug it and see how you you can play with it.
I will try to replicate the script today but it will be later on today, I can not spend time right now.
I will keep you updated, BR.
Seeking for Perl wisdom...on the process of learning...not there...yet!
| [reply] [d/l] [select] |
|
|
|
|
|
|
|
|
|
|
Re: Merging 2 xlsx files
by mnakkach (Novice) on Sep 07, 2017 at 06:46 UTC
|
| [reply] |
Re: Merging 2 xlsx files
by thanos1983 (Parson) on Sep 10, 2017 at 21:28 UTC
|
Hello again mnakkach,
Although I agree with the fellow Monks, you did not showed us any effort on trying to resolve your problem, at the same time a I am a firm believer that every question right or wrong should be answered to some extend at least.
I have seen people asking on how to append excel sheets, so I thought to give it a try and try to play around with this issue for future reference in case that someone might need an answer to some extend (answer).
The script bellow that I wrote will do the very basic in just reading the characters in the cells and simply append them on the each sheet that is read by each document. The script should be able to read multiple input spread sheets files, with multiple sheets each file and be able to handle them. I have not fully tested it, just minor tests I have run, any improvements feel free to add.
Hope this helps, BR.
Seeking for Perl wisdom...on the process of learning...not there...yet!
| [reply] [d/l] [select] |
|
|
| [reply] |
Re: Merging 2 xlsx files (UPDATED)
by thanos1983 (Parson) on Sep 12, 2017 at 23:29 UTC
|
Hello again mnakkach,
I was thinking again and again the case and I found my previous solution Re: Merging 2 xlsx files to your problem not correct.
Why it is not correct let's assume that you have 2 lines on first spreadsheet all in colum A and also on second spreadsheet two lines on column A. The old script will work just fine as long as all the data are still in column A. In case that the second spreadsheet (the appending) data are in column B, even if the column B has only on line e.g. B1 then after the process the B1 will be passed to B5. Why? simply because I did a wrong calculation of the keys in the hash.
To resolve this issue, but unfortunately only for columns A-Z see the solution bellow:
Update: I finally managed to put it together a solution that works also for longer columns like AA. Hope this script will help other people in future.
I will try to resolve the issue with the columns but so far I am stack, I will update as soon as I have resolved it.
Hope this helps, BR.
Seeking for Perl wisdom...on the process of learning...not there...yet!
| [reply] [d/l] [select] |
|
|
| [reply] |
|
|
Hello mnakkach,
If you are trying to learn programming you really are not showing any effort. As the fellow Monks already said this is a not a free code forum. Show us some effort, show us your code and then you can ask for advice / code improvements etc.
I will answer your question because I found it extremely easy. Did you read the documentation of the Excel::Writer::XLSX/write_comment( $row, $column, $string, ... ). Regarding reading the comments from you spread sheet, this is for you to figure it out. Show us the effort and we will try to help.
Hope this helps, BR.
Seeking for Perl wisdom...on the process of learning...not there...yet!
| [reply] [d/l] [select] |
|
|