Hi,

I have a set of json data from which I want to extract a specific pattern and print it as a table based on time. In the _DATA_ below (which is json), I wouldnt need to decode json as the information that I need is already in a extractable format, but I need to export every occurance of the below information from the json and sort it based on the latest time. I can use arrays to feed each value and sort it, but how can I use regular expression to loop through this data, and extract the below information for every occurance. Kindly help.

Latest Time = 1390789741000 Ecompressed = 19955876 Euncompressed = 29837736 ICompressed = 248395 IUncompressed = 656440 _DATA_ {"ingressClosedConnections":1,"bytesSeries":[[1390789541000,1163,4588, +972,3076],[1390789521000,282,1088,261,1280],[1390789501000,1177,4636, +1005,3124],[1390789481000,1117,4492,937,2708],[1390789461000,409,1632 +,366,1472],[1390789441000,1182,4636,989,3124],[1390789421000,1104,414 +0,945,2980],[1390789401000,389,1584,325,1168],[1390786321000,572,1968 +,572,2260],[1390786301000,1118,4588,957,3332],[1390786281000,902,3804 +,681,1936],[1390786261000,605,2016,622,2308],[1390786241000,1179,4636 +,976,3380],[1390786221000,980,4252,726,2032],[1390786201000,497,1824, +506,1844],[1390786181000,1101,4140,926,3236],[1390786161000,1043,4300 +,766,2080]],"eCompressed":19955876,"peakConnections":1,"iNewConnectio +ns":1,"eUncompressed":29837736,"iUncompressed":656440,"iCompressed":2 +48395,"latestTime":1390789741000,"egressClosedConnections":1,"connect +ionSeries":[[1390789741000,0,0],[1390789721000,0,0],[1390789701000,0, +0],[1390789681000,0,0],[1390789661000,0,0],[1390789641000,0,0],[13907 +89621000,0,0],[1390789601000,0,0],[1390789581000,0,0],[1390789561000, +0,0],[1390789541000,0,0],[1390789521000,0,0],[1390789501000,0,0],[139 +0789481000,0,0],[1390789461000,0,0],[1390789441000,0,0],[139078942100 +0,0,0],[1390789401000,0,0],[1390789381000,0,0],[1390786321000,1,0],[1 +390786301000,1,0],[1390786281000,1,0],[1390786261000,1,0],[1390786241 +000,1,0],[1390786221000,1,0],[1390786201000,1,0],[1390786181000,1,0] ,"eCompressed":19955876,"peakConnections":1,"iNewConnections":1,"eUnco +mpressed":29837736,"iUncompressed":656440,"iCompressed":248395,"lates +tTime":1390789741000,"egressClosedConnections":1,"connectionSeries":[ +[1390789741000,0,0],[1390789721000,0,0],[1390789701000,0,0],[13907896 +81000,0,0],[1390789661000,0,0], ..... ,"eCompressed":19955876,"peakConnections":1,"iNewConnections":1,"eUnco +mpressed":29837736,"iUncompressed":656440,"iCompressed":248395,"lates +tTime":1390789741000,"egressClosedConnections":1,"connectionSeries":[ +[1390789741000,0,0],[1390789721000,0,0],[1390789701000,0,0],[13907896 +81000,0,0],[1390789661000,0,0], .... ,"eCompressed":19955876,"peakConnections":1,"iNewConnections":1,"eUnco +mpressed":29837736,"iUncompressed":656440,"iCompressed":248395,"lates +tTime":1390789741000,"egressClosedConnections":1,"connectionSeries":[ +[1390789741000,0,0],[1390789721000,0,0],[1390789701000,0,0],[13907896 +81000,0,0],[1390789661000,0,0],

In reply to Help extracting pattern of data by spikeinc

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.