Re: Parsing pipe delimited file

2003-10-25 Thread Wiggins d'Anconia
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

Re: Parsing pipe delimited file

2003-10-25 Thread David Storrs
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

RE: Parsing pipe delimited file

2003-10-22 Thread Charles K. Clarkson
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 (

RE: Parsing pipe delimited file

2003-10-22 Thread Kevin Pfeiffer
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

RE: Parsing pipe delimited file

2003-10-22 Thread Kevin Pfeiffer
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

RE: Parsing pipe delimited file

2003-10-22 Thread Charles K. Clarkson
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

Re: Parsing pipe delimited file

2003-10-22 Thread Kevin Pfeiffer
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

Re: Parsing pipe delimited file

2003-10-21 Thread R. Joseph Newton
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

Re: Parsing pipe delimited file

2003-10-21 Thread Kevin Pfeiffer
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

Re: Parsing pipe delimited file

2003-10-21 Thread Kevin Pfeiffer
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

Re: Parsing pipe delimited file

2003-10-21 Thread Kevin Old
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

Re: Parsing pipe delimited file

2003-10-21 Thread Katy Brownfield
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

Re: Parsing pipe delimited file

2003-10-21 Thread Kevin Pfeiffer
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"||| ||

Re: Parsing pipe delimited file

2003-10-21 Thread Kevin Pfeiffer
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

Re: Parsing pipe delimited file

2003-10-21 Thread Kevin Old
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

Re: Parsing pipe delimited file

2003-10-21 Thread Rob Dixon
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

Parsing pipe delimited file

2003-10-21 Thread Kevin Old
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