|
|
| Keep It Simple, Stupid | |
| PerlMonks |
Win32::OLE and Excel: Iterating when certain row numbers are missingby ownlifeful (Beadle) |
| on Jun 21, 2021 at 12:18 UTC ( [id://11134106]=perlquestion: print w/replies, xml ) | Need Help?? |
|
ownlifeful has asked for the wisdom of the Perl Monks concerning the following question: Greetings, esteemed Perl Monks! I have spent several hours searching for an answer. I'd sincerely appreciate any help. I'm working on a script using Strawberry Perl and Win32::OLE, to read and write (manipulate) Excel spreadsheets. The input files to be processed by this script don't have all the rows numbers. I assumed that spreadsheet rows are always numbered with contiguous natural numbers, beginning with 1. Ex: A1,A2,A3,A4,A5,A6... Well, the spreadsheets I need to process have rows numbered: A1,A3,A4,A5,A6,A217,A219,A220,A221,A350, ... ( What fresh hell is this?!??! ) So my question is -- How do I do "some computation" for every cell in a given column, given noncontiguous row numbers? Sure, I can do the following:
This won't always work. I'm trying to keep track of the current row number in a counter variable ( $current_row ). Simply incrementing the counter won't work. If only there were something like a "row_number" attribute that I could peek at, to determine which row is currently being processed. Any ideas? Thanks in advance!
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||||