Subject: | XML::CSV Single Column Fails |
Date: | Thu, 18 Jun 2015 15:49:57 -0400 |
To: | bug-XML-CSV [...] rt.cpan.org |
From: | "Larry Irwin (work)" <larry.irwin [...] ccamedical.com> |
Hi,
XML::CSV currently fails to work when a csv file has only a single column.
ccadev:/u/lri# l test*
-rw-rw-rw- 1 root root 15 Jun 18 15:29 test.csv
-rwxr-xr-x 1 root root 141 Jun 18 14:39 test.pl
ccadev:/u/lri# cat test.pl
#!/usr/bin/perl
use XML::CSV; $csv_obj = XML::CSV->new();
$csv_obj->parse_doc("test.csv", {headings => 1});
$csv_obj->print_xml("test.xml");
ccadev:/u/lri# cat test.csv
"name"
"Larry"
ccadev:/u/lri# ./test.pl
There is no data to print, make sure that you parsed the document before
printing at ./test.pl line 3.
If you add a comma to the end of each field, it executes, but it
produces an empty tag entry:
<records>
<record>
<name>Larry</name>
<></>
</record>
</records>
When running in a scripted manner, you never know how many columns there
will be, if any...
Thanks for making XML::CSV available!
Larry Irwin
--
Larry Irwin
V.P. Development
CCA Medical
Ph: 864-233-2700 ext 225
Fax: 864-271-1755
Cell: 864-525-1322
Email:larry.irwin@ccamedical.com