in reply to excel columns and my ignorance

trickyq:

If you read the documentation for Spreadsheet::XLSX, the very first thing you'll see is a bit of example code to open a spreadsheet and access the contents, once cell at a time. The tricky bits of the example code are:

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^2: excel columns and my ignorance
by trickyq (Acolyte) on May 31, 2012 at 18:21 UTC

    I see that. However, if the variable $col holds the column # by default how do i tell it to give me just column 0 and column 3? I'm missing some essential piece of this. can you type a line of code that would access Column 0 only (or A in excel)? I would get it all if i could see that

    thanks

      Does this help
      use strict; use Spreadsheet::XLSX; my $excel = Spreadsheet::XLSX -> new ('build.xlsx'); my $sheet = $excel->Worksheet('Sheet1'); my ($row_min,$row_max) = $sheet->row_range(); my @col=(); for my $row ($row_min..$row_max){ $col[0] = $sheet->{Cells}[$row][0]->{Val}; $col[3] = $sheet->{Cells}[$row][3]->{Val}; print "$row $col[0] $col[3] \n" }
      poj

        YES!

        I kneel before Zod