Subject: | column header problems |
Date: | Tue, 17 Sep 2013 13:37:01 -0700 (PDT) |
To: | bug-Data-Table-Excel [...] rt.cpan.org |
From: | John Bartelt <bartelt [...] slac.stanford.edu> |
I am using xlsx2tables to import one sheet from an .xlsx file.
This mostly works, except for problems with the column headers.
(1) A first row is created with contents "col1, col2, col3, ..."
(2) The second row has the real column headers from the xlsx file.
Except the first column is blank. That is, if I output this as
a CSV file, the first two rows are:
col1,col2,col3,col4,col5,col6
,Region Type,Type,Manufacturer,Part Number,Name
The first problem can be dealt with simply by deleting it.
The second problem is more pernicious. I am puzzled why this one row
is missing its first entry. The other rows are fine.
Thanks for any help. My simple script is listed below, in case this is
a coding error on my part.
John Bartelt
#!/usr/local/bin/perl
use strict;
use Data::Table;
use Data::Table::Excel qw(xlsx2tables);
my $t = new Data::Table;
my ($t, $names) = xlsx2tables("RT-File.xlsx", undef, [1]);
my $out = "RT-File.csv";
open (OUT, ">$out");
print OUT $t->[0]->csv;
close OUT;