Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I appreciate your intent to roll your on, but I instead suggest to use Text::ParseWords, it's part of Perl standard distribution. You can learn the logic from there, or from other module suggested by other monks in this thread.
#!/usr/bin/perl use strict; use warnings; use Text::ParseWords; while (<DATA>) { chomp; my @parts = parse_line(',', 0, $_); print join(' ', map { "[$_]" } @parts), "\n"; } __DATA__ Submitted,"696,028","50,946","810,590","836,505","13,923,241","13,776, +443","14,179,619","14,614,558","14,704,885","14,634,911","15,055,774" +,"15,127,534","14,458,899","14,403,378","14,566,425","14,644,406","14 +,524,069" Expired,245,275,273,248,240,295,353,316,371,398,387,352,310,288,405,27 +4,270 Less in,90.12%,90.49%,90.04%,89.55%,90.09%,90.63%,90.37%,90.48%,90.73% +,90.59%,90.83%,90.40%,88.82%,90.71%,90.72%,90.69%,91.04%
Output:
[Submitted] [696,028] [50,946] [810,590] [836,505] [13,923,241] [13,77 +6,443] [14,179,619] [14,614,558] [14,704,885] [14,634,911] [15,055,77 +4] [15,127,534] [14,458,899] [14,403,378] [14,566,425] [14,644,406] [ +14,524,069] [Expired] [245] [275] [273] [248] [240] [295] [353] [316] [371] [398] +[387] [352] [310] [288] [405] [274] [270] [Less in] [90.12%] [90.49%] [90.04%] [89.55%] [90.09%] [90.63%] [90.37 +%] [90.48%] [90.73%] [90.59%] [90.83%] [90.40%] [88.82%] [90.71%] [90 +.72%] [90.69%] [91.04%]

Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!


In reply to Re: I would like to find a good logic to parse the data by naikonta
in thread I would like to find a good logic to parse the data by greatshots

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (8)
    As of 2014-09-18 02:51 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (105 votes), past polls