Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

correcting output

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

Need to make sure there is a return between my product entries. Notice the last entry and second entry run together. Also products is some random i just put product 1 and product 2 etc to provide the example text. Thank you to all who reply
Product 1 ------------------------------------------------------------------ storeId = 1001 phoneNumber = (111) 111-1111 availbilityCode = 1 stockStatus = Limited stock city = some city fullStreet = some address Product 2 ------------------------------------------------------------------ storeId = 2117 phoneNumber = (111) 111-1111 availbilityCode = 2 stockStatus = In stock city = some city fullStreet = some address Product 3 ------------------------------------------------------------------ storeId = 2123 phoneNumber = (111) 111-1111 availbilityCode = 1 stockStatus = Limited stock city = some city fullStreet = some address

Replies are listed 'Best First'.
Re: correcting output
by AnomalousMonk (Chancellor) on Mar 13, 2013 at 02:20 UTC
Re: correcting output
by Anonymous Monk on Mar 12, 2013 at 20:48 UTC

    How are you writing those records?

    You should probably collect all the data in a hash, then print it all at once in one place. You can make sure you've got a CRLF at the end of every record that way by looking at the print function.

Re: correcting output
by igelkott (Priest) on Mar 13, 2013 at 00:12 UTC

    Should clarify if you're trying to fix the script that makes this output or just "post-process" the resulting file.

    To get help with a fix, show the relevant part of the code to produce this. To get help with post-processing, it would be good to show at least some attempt to do this yourself.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1023047]
Approved by igelkott
[Corion]: The bots bow in response
[Discipulus]: so karlgoethebier, what this idiom is and where i can read about it? i tried to deparse and gives error..;=(
[karlgoethebier]: Eily: non-people == persone non grata?
[Your Mother]: Corion: I have lost the link to the pmdev guide(s). Do you have that handy?
[karlgoethebier]: Discipulus: see per lop please how to avoid the classic <c>perl 'rm -rfv *|'</>
[Eily]: karlgoethebier: more like grata non persona :P

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (12)
As of 2017-07-21 08:10 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (319 votes). Check out past polls.