drodinthe559 has asked for the wisdom of the Perl Monks concerning the following question:
Thanks. Dave#!/usr/bin/perl -w use strict; use warnings; use XML::Simple; use Text::CSV_XS; #open DIPFILE, ">> C:/director/DIPFILE.TXT"; #open LOGFILE, ">> C:/director/DIPLOG.LOG"; #Pull in all the xml files for each report. my @dipfile = glob('C:/director/*.xml'); my $csv = Text::CSV_XS->new({always_quote => 0}); foreach my $xml_file (@dipfile) { my $ref = XML::Simple::XMLin($xml_file, SuppressEmpty => ''); my ($fileName) = "//prime/ReportExtract/Director/" . $ref->{fileNa +me}; my ($default_name) = $ref->{defaultName}; my ($doc_type) = '1'; #Default set to unidentified Document Type. my ($default_description) = $ref->{defaultDescription}; my ($report_time) = $ref->{reportExecutionTime}; my ($reportSearchPath) = $ref->{reportSearchPath}; if (substr($reportSearchPath,23,10) eq "Operations"){$doc_type = 1 +719}; $csv->combine($fileName,$doc_type, $default_name,$default_descript +ion,$report_time); print $csv->string, "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Text::CSV_XS Issue
by Tux (Canon) on May 28, 2009 at 18:46 UTC | |
by drodinthe559 (Monk) on May 28, 2009 at 19:08 UTC | |
by Tux (Canon) on May 29, 2009 at 06:00 UTC | |
|
Re: Text::CSV_XS Issue
by ikegami (Patriarch) on May 28, 2009 at 18:46 UTC | |
by drodinthe559 (Monk) on May 28, 2009 at 18:54 UTC | |
by ikegami (Patriarch) on May 28, 2009 at 18:57 UTC | |
by drodinthe559 (Monk) on May 28, 2009 at 19:04 UTC | |
by ikegami (Patriarch) on May 28, 2009 at 19:15 UTC |