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"||| ||||||||||||||||||||||||||||||
[...]

I'm working on this myself and am wondering if -- er, what the better way is
to split the header line into 3 pieces.

    # get header
    if (/^[^|]/ and [EMAIL PROTECTED]) {
        @header = split(/"?[|"]+"?/, $_, 5);
        pop @header; shift @header;
    }

Data (see below) looks something like:
"Piece One"||||||"Piece Two"||||||"Piece Three"|||

I'm splitting as you see, but into 5 pieces in order to get rid of quote marks 
and all pipes; then I have to throw out the first and last item.

-K

__DATA__
"ALL-TIME FAVORITE COUNTRY LOVE SONGS UPC#: 0-84296-33172-7"||||||"COUNTRY MALE PARTY 
SONGS VOL. 1 UPC#: 0-84296-21772-4"||||||"COUNTRY FEMALE PARTY SONGS VOL. 1 UPC#: 
0-84296-21712-0"|||

-- 
Kevin Pfeiffer


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to