Hey I can see that people are helping you and you are on your way to having your problem solved.
Spreadsheet::XSLX is an awesome module, but sometimes its easier to convert the file to CSV using excel and then its just text and its a lot easier to manipulate. - Jose from Mexico On Wed, May 30, 2012 at 3:53 PM, Yu-Shan Wang <ysw2...@gmail.com> wrote: > Hi > > Can I ask a quick question? > My perl version is 5.8.3 > I couldn't find Spreadsheet::XLSX from ppm3 > I search online. It seems that my version is too old to support this > module. Is it correct? > > If so, is there other ways to parse *xlsm* file using perl v5.8.3 > Thank you very much > > -Tiffany > > > On Mon, May 28, 2012 at 12:57 AM, Ken Furff <frazzmata...@gmail.com> > wrote: > > > ok > > I used this code to try to get the columns 2,3,4,5. > > > > my @indexes = (2 .. (2+4-1)); > > my @dcells = > > @{$sheet->{Cells}[$row]}[@indexes]; > > > > foreach (@dcells) { > > print $_; > > } > > > > but when I try to print the cell values to the screen so I can see that > > its giving me what I need. it prints this stuff: > > > > > Spreadsheet::ParseExcel::Cell=HASH(0x70be710)Spreadsheet::ParseExcel::Cell=HASH(0x70be758)Spreadsheet::ParseExcel::Cell=HASH(0x70be710)Spreadsheet::ParseExcel::Cell=HASH(0x70be758) > > > > how do I access the actual data in the cell as opposed to this stuff? > > > > Thanks > > Ken > > > > > > On Thursday, May 24, 2012 8:41:36 AM UTC-7, Ken Furff wrote: > > > I am using the spreadsheet::xlsx module in a script im writing. I need > > to extract about 4 columns out of about 60. I need those specific columns > > for comparison and updating. I assume that I'll load the data into an > array > > or an array of arrays for comparison. I am able to extract the contents > of > > the file, but I cant figure out how to specify just those columns... I'll > > put the code i currently have below > > > > > > use Spreadsheet::XLSX; > > > > > > $excel = Spreadsheet::XLSX -> new ('build.xlsx'); > > > foreach my $sheet (@{$excel -> {Worksheet}}) { > > > > > > printf("Sheet: %s\n", $sheet->{Name}); > > > $sheet -> {MaxRow} ||=$sheet -> {MinRow}; > > > > > > foreach $row ($sheet -> {MinRow} .. $sheet -> {MaxRow}) { > > > > > > $sheet -> {MaxCol} ||= $sheet -> {MinCol}; > > > > > > foreach $col ($sheet -> {MinCol} .. $sheet -> {MaxCol}) { > > > > > > $cell = $sheet -> {Cells} [$row] [$col]; > > > > > > if ($cell) { > > > open FILE, ">>buildop.txt" or die $!; > > > printf FILE ("(%s , %s) => %s\n", $row, $col, $cell -> {Val}); > > > close FILE; > > > } > > > } > > > } > > > } > > > > > > this just prints the results to a file so I could examine it and try to > > figure out how to get just those columns > > > help > > > > > > > > On Thursday, May 24, 2012 8:41:36 AM UTC-7, Ken Furff wrote: > > > I am using the spreadsheet::xlsx module in a script im writing. I need > > to extract about 4 columns out of about 60. I need those specific columns > > for comparison and updating. I assume that I'll load the data into an > array > > or an array of arrays for comparison. I am able to extract the contents > of > > the file, but I cant figure out how to specify just those columns... I'll > > put the code i currently have below > > > > > > use Spreadsheet::XLSX; > > > > > > $excel = Spreadsheet::XLSX -> new ('build.xlsx'); > > > foreach my $sheet (@{$excel -> {Worksheet}}) { > > > > > > printf("Sheet: %s\n", $sheet->{Name}); > > > $sheet -> {MaxRow} ||=$sheet -> {MinRow}; > > > > > > foreach $row ($sheet -> {MinRow} .. $sheet -> {MaxRow}) { > > > > > > $sheet -> {MaxCol} ||= $sheet -> {MinCol}; > > > > > > foreach $col ($sheet -> {MinCol} .. $sheet -> {MaxCol}) { > > > > > > $cell = $sheet -> {Cells} [$row] [$col]; > > > > > > if ($cell) { > > > open FILE, ">>buildop.txt" or die $!; > > > printf FILE ("(%s , %s) => %s\n", $row, $col, $cell -> {Val}); > > > close FILE; > > > } > > > } > > > } > > > } > > > > > > this just prints the results to a file so I could examine it and try to > > figure out how to get just those columns > > > help > > > > > > > > On Thursday, May 24, 2012 8:41:36 AM UTC-7, Ken Furff wrote: > > > I am using the spreadsheet::xlsx module in a script im writing. I need > > to extract about 4 columns out of about 60. I need those specific columns > > for comparison and updating. I assume that I'll load the data into an > array > > or an array of arrays for comparison. I am able to extract the contents > of > > the file, but I cant figure out how to specify just those columns... I'll > > put the code i currently have below > > > > > > use Spreadsheet::XLSX; > > > > > > $excel = Spreadsheet::XLSX -> new ('build.xlsx'); > > > foreach my $sheet (@{$excel -> {Worksheet}}) { > > > > > > printf("Sheet: %s\n", $sheet->{Name}); > > > $sheet -> {MaxRow} ||=$sheet -> {MinRow}; > > > > > > foreach $row ($sheet -> {MinRow} .. $sheet -> {MaxRow}) { > > > > > > $sheet -> {MaxCol} ||= $sheet -> {MinCol}; > > > > > > foreach $col ($sheet -> {MinCol} .. $sheet -> {MaxCol}) { > > > > > > $cell = $sheet -> {Cells} [$row] [$col]; > > > > > > if ($cell) { > > > open FILE, ">>buildop.txt" or die $!; > > > printf FILE ("(%s , %s) => %s\n", $row, $col, $cell -> {Val}); > > > close FILE; > > > } > > > } > > > } > > > } > > > > > > this just prints the results to a file so I could examine it and try to > > figure out how to get just those columns > > > help > > > > > > > > On Thursday, May 24, 2012 8:41:36 AM UTC-7, Ken Furff wrote: > > > I am using the spreadsheet::xlsx module in a script im writing. I need > > to extract about 4 columns out of about 60. I need those specific columns > > for comparison and updating. I assume that I'll load the data into an > array > > or an array of arrays for comparison. I am able to extract the contents > of > > the file, but I cant figure out how to specify just those columns... I'll > > put the code i currently have below > > > > > > use Spreadsheet::XLSX; > > > > > > $excel = Spreadsheet::XLSX -> new ('build.xlsx'); > > > foreach my $sheet (@{$excel -> {Worksheet}}) { > > > > > > printf("Sheet: %s\n", $sheet->{Name}); > > > $sheet -> {MaxRow} ||=$sheet -> {MinRow}; > > > > > > foreach $row ($sheet -> {MinRow} .. $sheet -> {MaxRow}) { > > > > > > $sheet -> {MaxCol} ||= $sheet -> {MinCol}; > > > > > > foreach $col ($sheet -> {MinCol} .. $sheet -> {MaxCol}) { > > > > > > $cell = $sheet -> {Cells} [$row] [$col]; > > > > > > if ($cell) { > > > open FILE, ">>buildop.txt" or die $!; > > > printf FILE ("(%s , %s) => %s\n", $row, $col, $cell -> {Val}); > > > close FILE; > > > } > > > } > > > } > > > } > > > > > > this just prints the results to a file so I could examine it and try to > > figure out how to get just those columns > > > help > > > > > > On Thursday, May 24, 2012 8:41:36 AM UTC-7, Ken Furff wrote: > > > I am using the spreadsheet::xlsx module in a script im writing. I need > > to extract about 4 columns out of about 60. I need those specific columns > > for comparison and updating. I assume that I'll load the data into an > array > > or an array of arrays for comparison. I am able to extract the contents > of > > the file, but I cant figure out how to specify just those columns... I'll > > put the code i currently have below > > > > > > use Spreadsheet::XLSX; > > > > > > $excel = Spreadsheet::XLSX -> new ('build.xlsx'); > > > foreach my $sheet (@{$excel -> {Worksheet}}) { > > > > > > printf("Sheet: %s\n", $sheet->{Name}); > > > $sheet -> {MaxRow} ||=$sheet -> {MinRow}; > > > > > > foreach $row ($sheet -> {MinRow} .. $sheet -> {MaxRow}) { > > > > > > $sheet -> {MaxCol} ||= $sheet -> {MinCol}; > > > > > > foreach $col ($sheet -> {MinCol} .. $sheet -> {MaxCol}) { > > > > > > $cell = $sheet -> {Cells} [$row] [$col]; > > > > > > if ($cell) { > > > open FILE, ">>buildop.txt" or die $!; > > > printf FILE ("(%s , %s) => %s\n", $row, $col, $cell -> {Val}); > > > close FILE; > > > } > > > } > > > } > > > } > > > > > > this just prints the results to a file so I could examine it and try to > > figure out how to get just those columns > > > help > > > > > > > > On Thursday, May 24, 2012 8:41:36 AM UTC-7, Ken Furff wrote: > > > I am using the spreadsheet::xlsx module in a script im writing. I need > > to extract about 4 columns out of about 60. I need those specific columns > > for comparison and updating. I assume that I'll load the data into an > array > > or an array of arrays for comparison. I am able to extract the contents > of > > the file, but I cant figure out how to specify just those columns... I'll > > put the code i currently have below > > > > > > use Spreadsheet::XLSX; > > > > > > $excel = Spreadsheet::XLSX -> new ('build.xlsx'); > > > foreach my $sheet (@{$excel -> {Worksheet}}) { > > > > > > printf("Sheet: %s\n", $sheet->{Name}); > > > $sheet -> {MaxRow} ||=$sheet -> {MinRow}; > > > > > > foreach $row ($sheet -> {MinRow} .. $sheet -> {MaxRow}) { > > > > > > $sheet -> {MaxCol} ||= $sheet -> {MinCol}; > > > > > > foreach $col ($sheet -> {MinCol} .. $sheet -> {MaxCol}) { > > > > > > $cell = $sheet -> {Cells} [$row] [$col]; > > > > > > if ($cell) { > > > open FILE, ">>buildop.txt" or die $!; > > > printf FILE ("(%s , %s) => %s\n", $row, $col, $cell -> {Val}); > > > close FILE; > > > } > > > } > > > } > > > } > > > > > > this just prints the results to a file so I could examine it and try to > > figure out how to get just those columns > > > help > > > > > > -- > > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > > For additional commands, e-mail: beginners-h...@perl.org > > http://learn.perl.org/ > > > > > > >