Sorting blocks of data based on a particular row of data

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I was given the below script by this great community to help sort the rows of information.




BEGIN




FS=":"

PROCINFO["sorted_in"]="@val_str_asc";




/./

values[$1]=$0




/^$/

asort(values)

for (element in values)

print values[element]

print ""

delete values




END




asort(values)

for (element in values)

print values[element]





Each block are sorted alphabetically, which is working as originally intended (shown below). Now I am asked to sort all these blocks of data (each block of data has a physical space between each other) based on the sessionStartTime. I think this is going to be alot harder since each 8-line block needs to stick together.




cabLoginID:0557CAWG0FP27K31JG7Q

loginName:john

memoryInfo:jsHeapSizeLimit:2181038080

session:cabSessionID:05P2R3PJGKG2Y2XE4NCZ
sessionStartTime:2018-10-18T13:03:00.973Z

totalJSHeapSize:36675584

usedJSHeapSize:29721040

userAgent:Mozilla/5.0



cabLoginID:05P4X6K6GFPJ7K31EJ7H

loginName:bob

memoryInfo:jsHeapSizeLimit:2181038080

session:cabSessionID:0536XLJPG7BJXRN42A0F
sessionStartTime:2018-10-11T11:37:28.195Z

totalJSHeapSize:54501376

usedJSHeapSize:35478968

userAgent:Mozilla/5.0



cabLoginID:053XCDTF8D4J6PD3BG8P

loginName:jack

memoryInfo:jsHeapSizeLimit:2217857988

session:cabSessionID:052FPBP6Q6X2XGERWHBT
sessionStartTime:2018-10-01T01:04:10.899Z

totalJSHeapSize:42358792

usedJSHeapSize:36482584

userAgent:Mozilla/5.0




Desired result:




cabLoginID:053XCDTF8D4J6PD3BG8P

loginName:jack

memoryInfo:jsHeapSizeLimit:2217857988

session:cabSessionID:052FPBP6Q6X2XGERWHBT
sessionStartTime:2018-10-01T01:04:10.899Z

totalJSHeapSize:42358792

usedJSHeapSize:36482584

userAgent:Mozilla/5.0



cabLoginID:05P4X6K6GFPJ7K31EJ7H

loginName:bob

memoryInfo:jsHeapSizeLimit:2181038080

session:cabSessionID:0536XLJPG7BJXRN42A0F
sessionStartTime:2018-10-11T11:37:28.195Z

totalJSHeapSize:54501376

usedJSHeapSize:35478968

userAgent:Mozilla/5.0



cabLoginID:0557CAWG0FP27K31JG7Q

loginName:john

memoryInfo:jsHeapSizeLimit:2181038080

session:cabSessionID:05P2R3PJGKG2Y2XE4NCZ
sessionStartTime:2018-10-18T13:03:00.973Z

totalJSHeapSize:36675584

usedJSHeapSize:29721040

userAgent:Mozilla/5.0











share|improve this question







New contributor




Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    0
    down vote

    favorite












    I was given the below script by this great community to help sort the rows of information.




    BEGIN




    FS=":"

    PROCINFO["sorted_in"]="@val_str_asc";




    /./

    values[$1]=$0




    /^$/

    asort(values)

    for (element in values)

    print values[element]

    print ""

    delete values




    END




    asort(values)

    for (element in values)

    print values[element]





    Each block are sorted alphabetically, which is working as originally intended (shown below). Now I am asked to sort all these blocks of data (each block of data has a physical space between each other) based on the sessionStartTime. I think this is going to be alot harder since each 8-line block needs to stick together.




    cabLoginID:0557CAWG0FP27K31JG7Q

    loginName:john

    memoryInfo:jsHeapSizeLimit:2181038080

    session:cabSessionID:05P2R3PJGKG2Y2XE4NCZ
    sessionStartTime:2018-10-18T13:03:00.973Z

    totalJSHeapSize:36675584

    usedJSHeapSize:29721040

    userAgent:Mozilla/5.0



    cabLoginID:05P4X6K6GFPJ7K31EJ7H

    loginName:bob

    memoryInfo:jsHeapSizeLimit:2181038080

    session:cabSessionID:0536XLJPG7BJXRN42A0F
    sessionStartTime:2018-10-11T11:37:28.195Z

    totalJSHeapSize:54501376

    usedJSHeapSize:35478968

    userAgent:Mozilla/5.0



    cabLoginID:053XCDTF8D4J6PD3BG8P

    loginName:jack

    memoryInfo:jsHeapSizeLimit:2217857988

    session:cabSessionID:052FPBP6Q6X2XGERWHBT
    sessionStartTime:2018-10-01T01:04:10.899Z

    totalJSHeapSize:42358792

    usedJSHeapSize:36482584

    userAgent:Mozilla/5.0




    Desired result:




    cabLoginID:053XCDTF8D4J6PD3BG8P

    loginName:jack

    memoryInfo:jsHeapSizeLimit:2217857988

    session:cabSessionID:052FPBP6Q6X2XGERWHBT
    sessionStartTime:2018-10-01T01:04:10.899Z

    totalJSHeapSize:42358792

    usedJSHeapSize:36482584

    userAgent:Mozilla/5.0



    cabLoginID:05P4X6K6GFPJ7K31EJ7H

    loginName:bob

    memoryInfo:jsHeapSizeLimit:2181038080

    session:cabSessionID:0536XLJPG7BJXRN42A0F
    sessionStartTime:2018-10-11T11:37:28.195Z

    totalJSHeapSize:54501376

    usedJSHeapSize:35478968

    userAgent:Mozilla/5.0



    cabLoginID:0557CAWG0FP27K31JG7Q

    loginName:john

    memoryInfo:jsHeapSizeLimit:2181038080

    session:cabSessionID:05P2R3PJGKG2Y2XE4NCZ
    sessionStartTime:2018-10-18T13:03:00.973Z

    totalJSHeapSize:36675584

    usedJSHeapSize:29721040

    userAgent:Mozilla/5.0











    share|improve this question







    New contributor




    Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I was given the below script by this great community to help sort the rows of information.




      BEGIN




      FS=":"

      PROCINFO["sorted_in"]="@val_str_asc";




      /./

      values[$1]=$0




      /^$/

      asort(values)

      for (element in values)

      print values[element]

      print ""

      delete values




      END




      asort(values)

      for (element in values)

      print values[element]





      Each block are sorted alphabetically, which is working as originally intended (shown below). Now I am asked to sort all these blocks of data (each block of data has a physical space between each other) based on the sessionStartTime. I think this is going to be alot harder since each 8-line block needs to stick together.




      cabLoginID:0557CAWG0FP27K31JG7Q

      loginName:john

      memoryInfo:jsHeapSizeLimit:2181038080

      session:cabSessionID:05P2R3PJGKG2Y2XE4NCZ
      sessionStartTime:2018-10-18T13:03:00.973Z

      totalJSHeapSize:36675584

      usedJSHeapSize:29721040

      userAgent:Mozilla/5.0



      cabLoginID:05P4X6K6GFPJ7K31EJ7H

      loginName:bob

      memoryInfo:jsHeapSizeLimit:2181038080

      session:cabSessionID:0536XLJPG7BJXRN42A0F
      sessionStartTime:2018-10-11T11:37:28.195Z

      totalJSHeapSize:54501376

      usedJSHeapSize:35478968

      userAgent:Mozilla/5.0



      cabLoginID:053XCDTF8D4J6PD3BG8P

      loginName:jack

      memoryInfo:jsHeapSizeLimit:2217857988

      session:cabSessionID:052FPBP6Q6X2XGERWHBT
      sessionStartTime:2018-10-01T01:04:10.899Z

      totalJSHeapSize:42358792

      usedJSHeapSize:36482584

      userAgent:Mozilla/5.0




      Desired result:




      cabLoginID:053XCDTF8D4J6PD3BG8P

      loginName:jack

      memoryInfo:jsHeapSizeLimit:2217857988

      session:cabSessionID:052FPBP6Q6X2XGERWHBT
      sessionStartTime:2018-10-01T01:04:10.899Z

      totalJSHeapSize:42358792

      usedJSHeapSize:36482584

      userAgent:Mozilla/5.0



      cabLoginID:05P4X6K6GFPJ7K31EJ7H

      loginName:bob

      memoryInfo:jsHeapSizeLimit:2181038080

      session:cabSessionID:0536XLJPG7BJXRN42A0F
      sessionStartTime:2018-10-11T11:37:28.195Z

      totalJSHeapSize:54501376

      usedJSHeapSize:35478968

      userAgent:Mozilla/5.0



      cabLoginID:0557CAWG0FP27K31JG7Q

      loginName:john

      memoryInfo:jsHeapSizeLimit:2181038080

      session:cabSessionID:05P2R3PJGKG2Y2XE4NCZ
      sessionStartTime:2018-10-18T13:03:00.973Z

      totalJSHeapSize:36675584

      usedJSHeapSize:29721040

      userAgent:Mozilla/5.0











      share|improve this question







      New contributor




      Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I was given the below script by this great community to help sort the rows of information.




      BEGIN




      FS=":"

      PROCINFO["sorted_in"]="@val_str_asc";




      /./

      values[$1]=$0




      /^$/

      asort(values)

      for (element in values)

      print values[element]

      print ""

      delete values




      END




      asort(values)

      for (element in values)

      print values[element]





      Each block are sorted alphabetically, which is working as originally intended (shown below). Now I am asked to sort all these blocks of data (each block of data has a physical space between each other) based on the sessionStartTime. I think this is going to be alot harder since each 8-line block needs to stick together.




      cabLoginID:0557CAWG0FP27K31JG7Q

      loginName:john

      memoryInfo:jsHeapSizeLimit:2181038080

      session:cabSessionID:05P2R3PJGKG2Y2XE4NCZ
      sessionStartTime:2018-10-18T13:03:00.973Z

      totalJSHeapSize:36675584

      usedJSHeapSize:29721040

      userAgent:Mozilla/5.0



      cabLoginID:05P4X6K6GFPJ7K31EJ7H

      loginName:bob

      memoryInfo:jsHeapSizeLimit:2181038080

      session:cabSessionID:0536XLJPG7BJXRN42A0F
      sessionStartTime:2018-10-11T11:37:28.195Z

      totalJSHeapSize:54501376

      usedJSHeapSize:35478968

      userAgent:Mozilla/5.0



      cabLoginID:053XCDTF8D4J6PD3BG8P

      loginName:jack

      memoryInfo:jsHeapSizeLimit:2217857988

      session:cabSessionID:052FPBP6Q6X2XGERWHBT
      sessionStartTime:2018-10-01T01:04:10.899Z

      totalJSHeapSize:42358792

      usedJSHeapSize:36482584

      userAgent:Mozilla/5.0




      Desired result:




      cabLoginID:053XCDTF8D4J6PD3BG8P

      loginName:jack

      memoryInfo:jsHeapSizeLimit:2217857988

      session:cabSessionID:052FPBP6Q6X2XGERWHBT
      sessionStartTime:2018-10-01T01:04:10.899Z

      totalJSHeapSize:42358792

      usedJSHeapSize:36482584

      userAgent:Mozilla/5.0



      cabLoginID:05P4X6K6GFPJ7K31EJ7H

      loginName:bob

      memoryInfo:jsHeapSizeLimit:2181038080

      session:cabSessionID:0536XLJPG7BJXRN42A0F
      sessionStartTime:2018-10-11T11:37:28.195Z

      totalJSHeapSize:54501376

      usedJSHeapSize:35478968

      userAgent:Mozilla/5.0



      cabLoginID:0557CAWG0FP27K31JG7Q

      loginName:john

      memoryInfo:jsHeapSizeLimit:2181038080

      session:cabSessionID:05P2R3PJGKG2Y2XE4NCZ
      sessionStartTime:2018-10-18T13:03:00.973Z

      totalJSHeapSize:36675584

      usedJSHeapSize:29721040

      userAgent:Mozilla/5.0








      sort






      share|improve this question







      New contributor




      Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 20 mins ago









      Kam

      63




      63




      New contributor




      Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Kam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          Kam is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f477807%2fsorting-blocks-of-data-based-on-a-particular-row-of-data%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Kam is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          Kam is a new contributor. Be nice, and check out our Code of Conduct.












          Kam is a new contributor. Be nice, and check out our Code of Conduct.











          Kam is a new contributor. Be nice, and check out our Code of Conduct.













           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f477807%2fsorting-blocks-of-data-based-on-a-particular-row-of-data%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          The Forum (Inglewood, California)

          Palaiologos