Attach session numbers to its relevant IDs

Multi tool use
Multi tool use

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











up vote
0
down vote

favorite












I have long records were collected as an output of a code,



Part1=STS768976N-4BT345432-X00001-87675789AAAS Session=9
Part2=STS876578N-2BT234522-X00002-23456789UJHG Session=10
Part3=ST9876887N-1BT876577-X00003-65778978KJUH Session=11
Session=10 70000
Session=11 80000
Session=9 90000


I want to organize the data like this



Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000


how can i do that









share









New contributor




Simon Q 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 have long records were collected as an output of a code,



    Part1=STS768976N-4BT345432-X00001-87675789AAAS Session=9
    Part2=STS876578N-2BT234522-X00002-23456789UJHG Session=10
    Part3=ST9876887N-1BT876577-X00003-65778978KJUH Session=11
    Session=10 70000
    Session=11 80000
    Session=9 90000


    I want to organize the data like this



    Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
    Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
    Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000


    how can i do that









    share









    New contributor




    Simon Q 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 have long records were collected as an output of a code,



      Part1=STS768976N-4BT345432-X00001-87675789AAAS Session=9
      Part2=STS876578N-2BT234522-X00002-23456789UJHG Session=10
      Part3=ST9876887N-1BT876577-X00003-65778978KJUH Session=11
      Session=10 70000
      Session=11 80000
      Session=9 90000


      I want to organize the data like this



      Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
      Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
      Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000


      how can i do that









      share









      New contributor




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











      I have long records were collected as an output of a code,



      Part1=STS768976N-4BT345432-X00001-87675789AAAS Session=9
      Part2=STS876578N-2BT234522-X00002-23456789UJHG Session=10
      Part3=ST9876887N-1BT876577-X00003-65778978KJUH Session=11
      Session=10 70000
      Session=11 80000
      Session=9 90000


      I want to organize the data like this



      Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
      Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
      Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000


      how can i do that







      text-processing text-formatting





      share









      New contributor




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










      share









      New contributor




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








      share



      share








      edited 3 mins ago









      Jeff Schaller

      33.8k851113




      33.8k851113






      New contributor




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









      asked 3 mins ago









      Simon Q

      283




      283




      New contributor




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





      New contributor





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






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




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          awk can do it:



          awk '/Part/i[$2]=$1;next$1 in iprint i[$1],$2' file | sort -t= -k1

          Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
          Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
          Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000




          share




















            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
            );



            );






            Simon Q 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%2f474936%2fattach-session-numbers-to-its-relevant-ids%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            awk can do it:



            awk '/Part/i[$2]=$1;next$1 in iprint i[$1],$2' file | sort -t= -k1

            Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
            Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
            Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000




            share
























              up vote
              0
              down vote













              awk can do it:



              awk '/Part/i[$2]=$1;next$1 in iprint i[$1],$2' file | sort -t= -k1

              Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
              Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
              Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000




              share






















                up vote
                0
                down vote










                up vote
                0
                down vote









                awk can do it:



                awk '/Part/i[$2]=$1;next$1 in iprint i[$1],$2' file | sort -t= -k1

                Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
                Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
                Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000




                share












                awk can do it:



                awk '/Part/i[$2]=$1;next$1 in iprint i[$1],$2' file | sort -t= -k1

                Part1=STS768976N-4BT345432-X00001-87675789AAAS 90000
                Part2=STS876578N-2BT234522-X00002-23456789UJHG 70000
                Part3=ST9876887N-1BT876577-X00003-65778978KJUH 80000





                share











                share


                share










                answered 42 secs ago









                Goro

                8,47254283




                8,47254283




















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









                     

                    draft saved


                    draft discarded


















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












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











                    Simon Q 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%2f474936%2fattach-session-numbers-to-its-relevant-ids%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    5bNtfU Iob,rxV Nt4bkmfvEhMZlQkkl9ce1KpuvN9Hi7i1ZwENW0I4Qesrj 1a8g3 YoaYUy1BvmXk42RlCYwsKL
                    u2MjeDtejv1B hwl0fMj9Cwi4S7IoaUFot z1dQvoDh tHjo8KCFJ4Wp5 0,A6O5 Hh27ruRgTFWXV2VmamtFIx2zN9c94lhMdEN,O

                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    How many registers does an x86_64 CPU actually have?

                    Displaying single band from multi-band raster using QGIS