Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Doubts group data

by Anonymous Monk
on May 04, 2017 at 13:30 UTC ( [id://1189496]=note: print w/replies, xml ) Need Help??


in reply to Re: Doubts group data
in thread Doubts group data

Dear, I ran a test with this command line and it did not work. See below:

cat teste.txt

21997|||70049,,20170428154818,20170527235959||| 21997|||70070,,20170428154739,20170527235959||| 21998|||70049,,20170428154818,20170527235959||| 21998|||70070,,20170428154739,20170527235959||| 21998|||70071,,20170428154739,20170527235959||| perl -an '-F/\|\|\|/' -e 'm/\d/ or do{print qq<$k|||$v|||\n> ;$k=$v="" +;next};$k=$F[0];$v.=$F[1].qq|;|' teste.txt </p> Not Result for this command. My perl version is: perl -v This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

Replies are listed 'Best First'.
Re^3: Doubts group data
by NetWallah (Canon) on May 04, 2017 at 13:40 UTC
    Your data does not have the blank line separating entries with the same ID.

    My code also requires a trailing line separator.

            ...Disinformation is not as good as datinformation.               Don't document the program; program the document.

Re^3: Doubts group data
by no_slogan (Deacon) on May 04, 2017 at 13:45 UTC
    His code depends on having a blank line between the 21997s and 21998s (as you show in your original post), and one at the end of the file. This limitation is easily fixable.
      Can you help me fix it?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2024-04-19 08:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found