/ Published in: Perl
Useful perl snippet to convert csv docs to xml from Ankh on the freenode #xml irc channel
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#! /usr/bin/perl use warnings; use strict; use Text::CSV; # generate XML from CSV files # my $csv = Text::CSV->new( { binary => 1, # binary for utf8, latin1 etc sep_char => "\t" } $csv->eol(" "); foreach (@ARGV) { while (my $colref = $csv->getline($input)) { "</row>\n"; } }