Hi,
Please see below code snippet and advise on what I may be doing wrong. Trying to print only once instance of EAN or ISBN per record. Each xml record lists one or multiple ISBN or EAN identifiers, but I want my output to list (in this order) the first found EAN, and if no EAN exists the...
It worked like a charm! Thank you both for your assistance on this thread.
Hashes were never my strong suit, and this piece of code is sending me back to the reference books so as to brush up on them and add appropriate notes next to each code line for future reference.
Here's a strange thing...
Hi Kevin,
Yes, I am stuck!
I tried your code (below) and saw the results, but not sure how to re-arrange what I see into what I need. Any guidance would be appreciated!
use Data::Dumper;
my %HoA = ();
while(<FILE>){
if (/^<(\w+)>(.*)$/) {
push @{$HoA{$1}},$2;
}
}
print Dumper \%HoA...
I've tried every which way (newbie here), but can't seem to come up with a good solution.
here's an example of the raw data:
<tag1>01234567890
<tag2>apple
<tag3>juice
<end>
<tag1>12345678901
<tag2>orange
<tag3>juice
<tag4>ACT
<end>
Here's the desired (pipe-delimited) output needed...
I came up with this code, but it only gives me the first product record. How would i edit it to get all of the records?
#!usr/bin/perl
use strict;
use XML::Simple;
our $file = 'test_file.xml';
our $xml = XML::Simple->new();
our $data = $xml->XMLin($file);
foreach my...
I am reading through and trying out the perl forum post right before mine and will post back my results (if any). In the meantime, please send whatever suggestions you may have.
thx
Hi there,
I'm new to XML and having a hard time with below.
here is my original XML data:
<productidentifier>
<b221>02</b221>
<b244>0123456789</b244>
</productidentifier>
<productidentifier>
<b221>03</b221>
<b244>9780123456789</b244>
</productidentifier>
<othertext>
<d102>02</d102>...
travs69 you hit it on the nose! I moved my perl script from where it was originally (folder name with spaces) onto the main C drive. That did it.
Thanks for the help everyone!
I tried various times since last night, I even now have it down to every two minutes...nada.
*/2 * * * * C:\Perl\bin\perl.exe C:\Documents and Settings\Me\My Documents\create_ftp_output.plx
does the crontab.txt file need to be in a different path? it's currently in the original path where it...
thanks for catching that Mike042. I went back and edited the crontab.txt file to :
2 * * * * C:\Perl\bin\perl.exe C:\Documents and Settings\Me\My Documents\create_ftp_output.plx
and still waiting for some kind of output.
I'm on W-xp, so I installed cronw service last night. This is my first time dealing with crons. I already read the FAQ on this site, but everything is geared towards unix.
the intended perl script to be run via cronjob works fine when I run it directly, so I know that's not where the problem...
I need help figuring out how to incorporate/get sum total of strings, while inside a foreach block. any help will be appreciated.
Here's the code:
_________________________________________
#!usr/bin/perl
use strict;
use File::stat;
our $dir_path = 'C:\path_name';
open DIR, $dir_path or die...
here's an example of what i get:
file_name|size|mdtm
CDC_02172006_onix21.xml - 1284696 - 1140294143
and here's what I see for above file in the FTP server
CDC_02172006_onix21.xml - 1,212KB - 2/18/2006 3:22 PM
As you can see, even though there is a date in the file name, it is usually...
Hi rharsh,
thx for the info. It worked, except now I get the size/mdtm in binary (i think?). Is there a way to convert them to size to KB and mdtm to m/d/yyyy h:mm AM/PM?
GZPM
I have already read the cpan page, but the syntax is what gets me in trouble.
This is my first post, and after looking through various threads I still can't find a solution to below. A little help would be GREATLY appreciated.
Below script works swell, but now i've also been asked to include file size and modified date. I've tried a few i found on various threads, but...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.