Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
laziness, impatience, and hubris
 
PerlMonks  

Only printing multiline entries once

by diamondsandperls (Beadle)
on Mar 01, 2013 at 03:45 UTC ( #1021146=perlquestion: print w/ replies, xml ) Need Help??
diamondsandperls has asked for the wisdom of the Perl Monks concerning the following question:

I should have been more clear in my original post I do not want to completely remove entries on the multiline text output I have a variable that has all this data stored maybe i can parse directly from the variable prior to printing the output.

In the below instead of Product 1 printing twice i only want it to print once.



Product 1
------------------------------------------------------------------
storeId = 1001
phoneNumber = (111) 111-1111
availbilityCode = 1
stockStatus = Limited stock
distance = 9.12
city = some city
fullStreet = some address

Product 2
------------------------------------------------------------------
storeId = 2117
phoneNumber = (111) 111-1111
availbilityCode = 2
stockStatus = In stock
distance = 7.49
city = some city
fullStreet = some address

Product 3
------------------------------------------------------------------
storeId = 2123
phoneNumber = (111) 111-1111
availbilityCode = 1
stockStatus = Limited stock
distance = 8.83
city = some city
fullStreet = some address

Product 1
------------------------------------------------------------------
storeId = 1001
phoneNumber = (111) 111-1111
availbilityCode = 1
stockStatus = Limited stock
distance = 8.56
city = some city
fullStreet = some address

Comment on Only printing multiline entries once
Re: Only printing multiline entries once
by Kenosis (Priest) on Mar 01, 2013 at 05:07 UTC

    How do you determine which instance of Product 1 to print? What if there are 3 instances?

      I am not sure on this one that is why i turn here i have done things with hashes and %seen in the past but not multiline
        I am not sure on this one that is why i turn here ...

        The answer to that is not something we can help you with because, if you don't know, it is something you need to ask the people who set the problem. Once you know how duplicates are to be treated we can help you if you are still having difficulties coding a solution. We can't write the spec for you!

        Cheers,

        JohnGG

Re: Only printing multiline entries once (code)
by Anonymous Monk on Mar 01, 2013 at 06:15 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1021146]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (11)
As of 2014-04-16 12:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (425 votes), past polls