line up horizontaly security identifier numbers

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











up vote
3
down vote

favorite












I have these security identifiers IDs (SIDs)



SID_1
S-1-2-12-347289564783285475
SID_2
S-1-2-12-312478290434839212
S-1-2-12-312748912347723432
S-1-2-12-123475184123489632
SID_3
SID_4
S-1-2-12-384721849326143123
S-1-2-12-324624783246712332
SID_5
SID_6


and I need to line them up horizontally so I can feed them to an algorithm which only accept the IDs in this form:



SID_1:S-1-2-12-347289564783285475
SID_2:S-1-2-12-312478290434839212:S-1-2-12-312748912347723432:S-1-2-12-123475184123489632
SID_3
SID_4:S-1-2-12-384721849326143123:S-1-2-12-324624783246712332
SID_5
SID_6


thank you for any help you may provide!










share|improve this question



























    up vote
    3
    down vote

    favorite












    I have these security identifiers IDs (SIDs)



    SID_1
    S-1-2-12-347289564783285475
    SID_2
    S-1-2-12-312478290434839212
    S-1-2-12-312748912347723432
    S-1-2-12-123475184123489632
    SID_3
    SID_4
    S-1-2-12-384721849326143123
    S-1-2-12-324624783246712332
    SID_5
    SID_6


    and I need to line them up horizontally so I can feed them to an algorithm which only accept the IDs in this form:



    SID_1:S-1-2-12-347289564783285475
    SID_2:S-1-2-12-312478290434839212:S-1-2-12-312748912347723432:S-1-2-12-123475184123489632
    SID_3
    SID_4:S-1-2-12-384721849326143123:S-1-2-12-324624783246712332
    SID_5
    SID_6


    thank you for any help you may provide!










    share|improve this question

























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I have these security identifiers IDs (SIDs)



      SID_1
      S-1-2-12-347289564783285475
      SID_2
      S-1-2-12-312478290434839212
      S-1-2-12-312748912347723432
      S-1-2-12-123475184123489632
      SID_3
      SID_4
      S-1-2-12-384721849326143123
      S-1-2-12-324624783246712332
      SID_5
      SID_6


      and I need to line them up horizontally so I can feed them to an algorithm which only accept the IDs in this form:



      SID_1:S-1-2-12-347289564783285475
      SID_2:S-1-2-12-312478290434839212:S-1-2-12-312748912347723432:S-1-2-12-123475184123489632
      SID_3
      SID_4:S-1-2-12-384721849326143123:S-1-2-12-324624783246712332
      SID_5
      SID_6


      thank you for any help you may provide!










      share|improve this question















      I have these security identifiers IDs (SIDs)



      SID_1
      S-1-2-12-347289564783285475
      SID_2
      S-1-2-12-312478290434839212
      S-1-2-12-312748912347723432
      S-1-2-12-123475184123489632
      SID_3
      SID_4
      S-1-2-12-384721849326143123
      S-1-2-12-324624783246712332
      SID_5
      SID_6


      and I need to line them up horizontally so I can feed them to an algorithm which only accept the IDs in this form:



      SID_1:S-1-2-12-347289564783285475
      SID_2:S-1-2-12-312478290434839212:S-1-2-12-312748912347723432:S-1-2-12-123475184123489632
      SID_3
      SID_4:S-1-2-12-384721849326143123:S-1-2-12-324624783246712332
      SID_5
      SID_6


      thank you for any help you may provide!







      text-formatting






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 4 hours ago









      Jeff Schaller

      33.8k851113




      33.8k851113










      asked 4 hours ago









      Kasper

      374113




      374113




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          6
          down vote



          accepted










          with awk :



          awk '/^S-/s=s":"$1;nextsprint ss=$0ENDprint s' file

          SID_1:S-1-2-12-347289564783285475
          SID_2:S-1-2-12-312478290434839212:S-1-2-12-312748912347723432:S-1-2-12-123475184123489632
          SID_3
          SID_4:S-1-2-12-384721849326143123:S-1-2-12-324624783246712332
          SID_5
          SID_6





          share|improve this answer



























            up vote
            1
            down vote













            using sed



            sed -i ':a;N;$!ba;s/nS-/:S-/g' file
            SID_1:S-1-2-12-347289564783285475
            SID_2:S-1-2-12-312478290434839212:S-1-2-12-312748912347723432:S-1-2-12-123475184123489632
            SID_3
            SID_4:S-1-2-12-384721849326143123:S-1-2-12-324624783246712332
            SID_5
            SID_6





            share|improve this answer




















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



              );













               

              draft saved


              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f474348%2fline-up-horizontaly-security-identifier-numbers%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              6
              down vote



              accepted










              with awk :



              awk '/^S-/s=s":"$1;nextsprint ss=$0ENDprint s' file

              SID_1:S-1-2-12-347289564783285475
              SID_2:S-1-2-12-312478290434839212:S-1-2-12-312748912347723432:S-1-2-12-123475184123489632
              SID_3
              SID_4:S-1-2-12-384721849326143123:S-1-2-12-324624783246712332
              SID_5
              SID_6





              share|improve this answer
























                up vote
                6
                down vote



                accepted










                with awk :



                awk '/^S-/s=s":"$1;nextsprint ss=$0ENDprint s' file

                SID_1:S-1-2-12-347289564783285475
                SID_2:S-1-2-12-312478290434839212:S-1-2-12-312748912347723432:S-1-2-12-123475184123489632
                SID_3
                SID_4:S-1-2-12-384721849326143123:S-1-2-12-324624783246712332
                SID_5
                SID_6





                share|improve this answer






















                  up vote
                  6
                  down vote



                  accepted







                  up vote
                  6
                  down vote



                  accepted






                  with awk :



                  awk '/^S-/s=s":"$1;nextsprint ss=$0ENDprint s' file

                  SID_1:S-1-2-12-347289564783285475
                  SID_2:S-1-2-12-312478290434839212:S-1-2-12-312748912347723432:S-1-2-12-123475184123489632
                  SID_3
                  SID_4:S-1-2-12-384721849326143123:S-1-2-12-324624783246712332
                  SID_5
                  SID_6





                  share|improve this answer












                  with awk :



                  awk '/^S-/s=s":"$1;nextsprint ss=$0ENDprint s' file

                  SID_1:S-1-2-12-347289564783285475
                  SID_2:S-1-2-12-312478290434839212:S-1-2-12-312748912347723432:S-1-2-12-123475184123489632
                  SID_3
                  SID_4:S-1-2-12-384721849326143123:S-1-2-12-324624783246712332
                  SID_5
                  SID_6






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 4 hours ago









                  Goro

                  8,14153878




                  8,14153878






















                      up vote
                      1
                      down vote













                      using sed



                      sed -i ':a;N;$!ba;s/nS-/:S-/g' file
                      SID_1:S-1-2-12-347289564783285475
                      SID_2:S-1-2-12-312478290434839212:S-1-2-12-312748912347723432:S-1-2-12-123475184123489632
                      SID_3
                      SID_4:S-1-2-12-384721849326143123:S-1-2-12-324624783246712332
                      SID_5
                      SID_6





                      share|improve this answer
























                        up vote
                        1
                        down vote













                        using sed



                        sed -i ':a;N;$!ba;s/nS-/:S-/g' file
                        SID_1:S-1-2-12-347289564783285475
                        SID_2:S-1-2-12-312478290434839212:S-1-2-12-312748912347723432:S-1-2-12-123475184123489632
                        SID_3
                        SID_4:S-1-2-12-384721849326143123:S-1-2-12-324624783246712332
                        SID_5
                        SID_6





                        share|improve this answer






















                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote









                          using sed



                          sed -i ':a;N;$!ba;s/nS-/:S-/g' file
                          SID_1:S-1-2-12-347289564783285475
                          SID_2:S-1-2-12-312478290434839212:S-1-2-12-312748912347723432:S-1-2-12-123475184123489632
                          SID_3
                          SID_4:S-1-2-12-384721849326143123:S-1-2-12-324624783246712332
                          SID_5
                          SID_6





                          share|improve this answer












                          using sed



                          sed -i ':a;N;$!ba;s/nS-/:S-/g' file
                          SID_1:S-1-2-12-347289564783285475
                          SID_2:S-1-2-12-312478290434839212:S-1-2-12-312748912347723432:S-1-2-12-123475184123489632
                          SID_3
                          SID_4:S-1-2-12-384721849326143123:S-1-2-12-324624783246712332
                          SID_5
                          SID_6






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 4 hours ago









                          msp9011

                          3,63543862




                          3,63543862



























                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f474348%2fline-up-horizontaly-security-identifier-numbers%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              What does second last employer means? [closed]

                              Installing NextGIS Connect into QGIS 3?

                              One-line joke