David Storrs wrote:
On Wed, Oct 22, 2003 at 07:22:24PM +0200, Kevin Pfeiffer wrote:
In article <[EMAIL PROTECTED]>, Charles K. Clarkson
wrote:
Kevin Pfeiffer <[EMAIL PROTECTED]> wrote:
: Where I am stuck is on the question:
:
: Given an @array such as
: ("Title of Song", "Artist", "Title", "Ano
On Wed, Oct 22, 2003 at 07:22:24PM +0200, Kevin Pfeiffer wrote:
> In article <[EMAIL PROTECTED]>, Charles K. Clarkson
> wrote:
>
> > Kevin Pfeiffer <[EMAIL PROTECTED]> wrote:
> >
> > : Where I am stuck is on the question:
> > :
> > : Given an @array such as
> > : ("Title of Song", "Artist", "Tit
Kevin Pfeiffer <[EMAIL PROTECTED]> wrote:
: What I came up with (by trying instead of just asking): ;-)
:
: # removes leading and trailing quote marks
: s/^"|"$//g foreach @pairs;
It might be more efficient to use two statements like the
faq does with leading and trailing space.
foreach (
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote:
> In article <[EMAIL PROTECTED]>, Charles K. Clarkson
> wrote:
>
>> Kevin Pfeiffer <[EMAIL PROTECTED]> wrote:
>>
>> : Where I am stuck is on the question:
>> :
>> : Given an @array such as
>> : ("Title of Song", "Artist", "Title", "Another A
In article <[EMAIL PROTECTED]>, Charles K. Clarkson
wrote:
> Kevin Pfeiffer <[EMAIL PROTECTED]> wrote:
>
> : Where I am stuck is on the question:
> :
> : Given an @array such as
> : ("Title of Song", "Artist", "Title", "Another Artist", "etc"),
> : is there an easy way to strip out the quotation
Kevin Pfeiffer <[EMAIL PROTECTED]> wrote:
: Where I am stuck is on the question:
:
: Given an @array such as
: ("Title of Song", "Artist", "Title", "Another Artist", "etc"),
: is there an easy way to strip out the quotation marks.
s/"//g foreach @array;
HTH,
Charles K. Clarkson
--
Head
Hi all,
Here is what I have so far for this...
use strict;
# cannot remember syntax for "use warnings but no 'uninitialized'
my ($album, @upc_list);
my @data_src = parse_data();
print "Data Source: ";
print "$_ " foreach @data_src;
print "\n";
# test
my $album1 = $album->{$upc_list[0]};
fore
Kevin Old wrote:
> Hello everyone,
>
> Thanks to everyone who helped with my last problem last week. I've hit
> a snag in another problem this week.
>
> I need to parse the following data:
>
> "COUNTRY MUSIC HALL OF FAME UPC#: 0-84296-22922-2"||"COUNTRY FEMALE
> PARTY SONGS VOL. 2 UPC#: 0-8
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote:
[...]
> The thing to add (I'd have to check the Perl Cookbook for the terminology)
> is a "reverse lookup"(?) so that in addition to:
>
> $album{$upc}
>
> you could also access your data via:
>
> $album{$album_name}
>
> (I think -- trying to
In article <[EMAIL PROTECTED]>, Kevin Old wrote:
[...]
> Then the rest of the lines are "Tracks" and "Artists". What I need to
> do is get the appropriate tracks and artists in respective (@tracks,
> @artists) arrays inside the hash.
>
> Basically, I need to know how to write code that does this
On Tue, 2003-10-21 at 16:49, Kevin Pfeiffer wrote:
> In article <[EMAIL PROTECTED]>, Kevin Old wrote:
> [...]
> > I need to parse the following data:
> >
> > "COUNTRY MUSIC HALL OF FAME UPC#: 0-84296-22922-2"||"COUNTRY FEMALE
> > PARTY SONGS VOL. 2 UPC#: 0-84296-28682-9"||"COUNTRY MALE P
Exactly what structure you want to end up with isn't clear, but I assume
you that you need to keep the tracks and artists associated with their
UPCs. If there were only one upc and one track/artist per line, grouped by
upc, it would be easier. The position of the track/artist on each line is
wh
In article <[EMAIL PROTECTED]>, Kevin Old wrote:
[...]
> I need to parse the following data:
>
> "COUNTRY MUSIC HALL OF FAME UPC#: 0-84296-22922-2"||"COUNTRY FEMALE
> PARTY SONGS VOL. 2 UPC#: 0-84296-28682-9"||"COUNTRY MALE PARTY
> SONGS VOL. 2 UPC#: 0-84296-28652-2"||| ||
In article <[EMAIL PROTECTED]>, Rob Dixon wrote:
> Kevin Old wrote:
>>
>> Thanks to everyone who helped with my last problem last week. I've hit
>> a snag in another problem this week.
>>
>> I need to parse the following data:
>
> [snip]
>
>
>
> I'd like to help Kevin, but please post your da
On Tue, 2003-10-21 at 13:54, Rob Dixon wrote:
> Kevin Old wrote:
> >
> > Thanks to everyone who helped with my last problem last week. I've hit
> > a snag in another problem this week.
> >
> > I need to parse the following data:
>
> [snip]
>
>
>
> I'd like to help Kevin, but please post your d
Kevin Old wrote:
>
> Thanks to everyone who helped with my last problem last week. I've hit
> a snag in another problem this week.
>
> I need to parse the following data:
[snip]
I'd like to help Kevin, but please post your data
as an attachment or (even better) as an Internet
link. Line wrappi
Hello everyone,
Thanks to everyone who helped with my last problem last week. I've hit
a snag in another problem this week.
I need to parse the following data:
"COUNTRY MUSIC HALL OF FAME UPC#: 0-84296-22922-2"||"COUNTRY FEMALE
PARTY SONGS VOL. 2 UPC#: 0-84296-28682-9"||"COUNTRY MALE
Sorry - some spelling mistakes there:
"Rob Dixon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> Pablo Fischer wrote:
> > Thanks!!!
> >
> > That's what I was looking for!
> >
> > Yep, the file has a single record, It works, thanks!
> >
> > Now looking your code, the difference its
Pablo Fischer wrote:
> Thanks!!!
>
> That's what I was looking for!
>
> Yep, the file has a single record, It works, thanks!
>
> Now looking your code, the difference its the local $/. What does local $/ its
> doing?
The scalar $/ is a perdefined variable which is the 'input record
separator'. It
Thanks!!!
That's what I was looking for!
Yep, the file has a single record, It works, thanks!
Now looking your code, the difference its the local $/. What does local $/ its
doing?
Thanks!
>
> open ARCHIVO, 'MOVER.CPO' or die "Cannot open MOVER.CPO: $!";
> local $/;
> my $file = ;
> clo
Pablo Fischer wrote:
> Checking My code and trying with this:
>
> open(ARCHIVO, "MOVER.CPO");
> my $file = ; #Yes I know that I need to use and array, just trying
> #Cerramos el archivo
> close(ARCHIVO);
> #open ARCHIVO, 'MOVER.CPO' or die "Cannot open MOVER.CPO: $!";
> my ($num, $fulanos, $tiempo,
Checking My code and trying with this:
open(ARCHIVO, "MOVER.CPO");
my $file = ; #Yes I know that I need to use and array, just trying
#Cerramos el archivo
close(ARCHIVO);
#open ARCHIVO, 'MOVER.CPO' or die "Cannot open MOVER.CPO: $!";
my ($num, $fulanos, $tiempo, $subject, @bodyhtml, @bodytxt, $att
Hi again;
Maybe I explained a little (??) bad my problem,
Using the code of John with what I need to get:
open ARCHIVO, 'MOVER.CPO' or die "Cannot open MOVER.CPO: $!";
my ( $num, $fulanos, $tiempo, $subject, $bodyhtml, $bodytxt, $attach,
$fechaenvio );
while ( ) {
( $num, $fulanos, $tiem
Pablo Fischer wrote:
>
> Hi again
Hello,
> Ok, I have a file that each part of this is separated by pipes (|), so I load
By "each part" I think you mean each line?
> the file in an array and then split it, the file has 8 parts:
>
> Part 1: a Number
> Part 2: a Big String (Maybe Im gonna use a
I forgot what does print NEEDS to print..
> But When I print it doest print what it NEEDS to print, and example of the
> first pipes of F737.JOP:
>
> 1|Env7371.txt(6)|1|1
>
> And it prints:
>
> 136 | | | | |
And I Should be
print "$num | @fulanos | $tiempo | $subject | $attach | $fechaenvio\
Hi again
Ok, I have a file that each part of this is separated by pipes (|), so I load
the file in an array and then split it, the file has 8 parts:
Part 1: a Number
Part 2: a Big String (Maybe Im gonna use an array in this part)
Part 3: a Number
Part 4: a String
Part 5: a BIG text (the same as
26 matches
Mail list logo