Sort lines in a file on 2 keys with variable text

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











up vote
1
down vote

favorite
1












I am a DBA and have the output from a reorg generation process that gives me DML in the following format :




REORG TABLE SCHEMA.A some other options
REORG TABLE SCHEMA.B some other options
REORG TABLE SCHEMA.C some other options
REORG TABLE SCHEMA.D some other options
REORG INDEXES ALL FOR TABLE SCHEMA.A some other options
REORG INDEXES ALL FOR TABLE SCHEMA.B some other options
REORG INDEXES ALL FOR TABLE SCHEMA.C some other options
REORG INDEXES ALL FOR TABLE SCHEMA.D some other options
RUNSTATS ON TABLE SCHEMA.A some other options
RUNSTATS ON TABLE SCHEMA.B some other options
RUNSTATS ON TABLE SCHEMA.C some other options
RUNSTATS ON TABLE SCHEMA.D some other options


For reasons I won't go in to here, i need this file sorted into the following order (note there might be less or more than 4 tables, or less or more than 3 entries per table):




REORG TABLE SCHEMA.A
REORG INDEXES ALL FOR TABLE SCHEMA.A
RUNSTATS ON TABLE SCHEMA.A
REORG TABLE SCHEMA.B
REORG INDEXES ALL FOR TABLE SCHEMA.B
RUNSTATS ON TABLE SCHEMA.B
...etc


ie. REORG TABLES, REORG INDEX then RUNSTAT for each table in the file.



I have tried the following (plus variants):




sort -t. -k2 test.fil
sort -t. -k2.1,2.8 -k1.1,1.7 test.fil


but the issue seems to be getting the secondary sorting (REORG TABLE, REORG INDEX then RUNSTAT) working correctly.



The first sort command above gets objects in order of descending table name, then sorted by length of k2.



The second sort command doesn't account for the fact that TABLE comes after INDEX (T after I) in the alphabet, but that I need INDEX after Table.



Any gurus out there that can help, muchly appreciated. Maybe there's other awk's and linux commands to use in conjunction?



I've also been through the sort command options, maybe there's some i've missed.







share|improve this question























    up vote
    1
    down vote

    favorite
    1












    I am a DBA and have the output from a reorg generation process that gives me DML in the following format :




    REORG TABLE SCHEMA.A some other options
    REORG TABLE SCHEMA.B some other options
    REORG TABLE SCHEMA.C some other options
    REORG TABLE SCHEMA.D some other options
    REORG INDEXES ALL FOR TABLE SCHEMA.A some other options
    REORG INDEXES ALL FOR TABLE SCHEMA.B some other options
    REORG INDEXES ALL FOR TABLE SCHEMA.C some other options
    REORG INDEXES ALL FOR TABLE SCHEMA.D some other options
    RUNSTATS ON TABLE SCHEMA.A some other options
    RUNSTATS ON TABLE SCHEMA.B some other options
    RUNSTATS ON TABLE SCHEMA.C some other options
    RUNSTATS ON TABLE SCHEMA.D some other options


    For reasons I won't go in to here, i need this file sorted into the following order (note there might be less or more than 4 tables, or less or more than 3 entries per table):




    REORG TABLE SCHEMA.A
    REORG INDEXES ALL FOR TABLE SCHEMA.A
    RUNSTATS ON TABLE SCHEMA.A
    REORG TABLE SCHEMA.B
    REORG INDEXES ALL FOR TABLE SCHEMA.B
    RUNSTATS ON TABLE SCHEMA.B
    ...etc


    ie. REORG TABLES, REORG INDEX then RUNSTAT for each table in the file.



    I have tried the following (plus variants):




    sort -t. -k2 test.fil
    sort -t. -k2.1,2.8 -k1.1,1.7 test.fil


    but the issue seems to be getting the secondary sorting (REORG TABLE, REORG INDEX then RUNSTAT) working correctly.



    The first sort command above gets objects in order of descending table name, then sorted by length of k2.



    The second sort command doesn't account for the fact that TABLE comes after INDEX (T after I) in the alphabet, but that I need INDEX after Table.



    Any gurus out there that can help, muchly appreciated. Maybe there's other awk's and linux commands to use in conjunction?



    I've also been through the sort command options, maybe there's some i've missed.







    share|improve this question





















      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      I am a DBA and have the output from a reorg generation process that gives me DML in the following format :




      REORG TABLE SCHEMA.A some other options
      REORG TABLE SCHEMA.B some other options
      REORG TABLE SCHEMA.C some other options
      REORG TABLE SCHEMA.D some other options
      REORG INDEXES ALL FOR TABLE SCHEMA.A some other options
      REORG INDEXES ALL FOR TABLE SCHEMA.B some other options
      REORG INDEXES ALL FOR TABLE SCHEMA.C some other options
      REORG INDEXES ALL FOR TABLE SCHEMA.D some other options
      RUNSTATS ON TABLE SCHEMA.A some other options
      RUNSTATS ON TABLE SCHEMA.B some other options
      RUNSTATS ON TABLE SCHEMA.C some other options
      RUNSTATS ON TABLE SCHEMA.D some other options


      For reasons I won't go in to here, i need this file sorted into the following order (note there might be less or more than 4 tables, or less or more than 3 entries per table):




      REORG TABLE SCHEMA.A
      REORG INDEXES ALL FOR TABLE SCHEMA.A
      RUNSTATS ON TABLE SCHEMA.A
      REORG TABLE SCHEMA.B
      REORG INDEXES ALL FOR TABLE SCHEMA.B
      RUNSTATS ON TABLE SCHEMA.B
      ...etc


      ie. REORG TABLES, REORG INDEX then RUNSTAT for each table in the file.



      I have tried the following (plus variants):




      sort -t. -k2 test.fil
      sort -t. -k2.1,2.8 -k1.1,1.7 test.fil


      but the issue seems to be getting the secondary sorting (REORG TABLE, REORG INDEX then RUNSTAT) working correctly.



      The first sort command above gets objects in order of descending table name, then sorted by length of k2.



      The second sort command doesn't account for the fact that TABLE comes after INDEX (T after I) in the alphabet, but that I need INDEX after Table.



      Any gurus out there that can help, muchly appreciated. Maybe there's other awk's and linux commands to use in conjunction?



      I've also been through the sort command options, maybe there's some i've missed.







      share|improve this question











      I am a DBA and have the output from a reorg generation process that gives me DML in the following format :




      REORG TABLE SCHEMA.A some other options
      REORG TABLE SCHEMA.B some other options
      REORG TABLE SCHEMA.C some other options
      REORG TABLE SCHEMA.D some other options
      REORG INDEXES ALL FOR TABLE SCHEMA.A some other options
      REORG INDEXES ALL FOR TABLE SCHEMA.B some other options
      REORG INDEXES ALL FOR TABLE SCHEMA.C some other options
      REORG INDEXES ALL FOR TABLE SCHEMA.D some other options
      RUNSTATS ON TABLE SCHEMA.A some other options
      RUNSTATS ON TABLE SCHEMA.B some other options
      RUNSTATS ON TABLE SCHEMA.C some other options
      RUNSTATS ON TABLE SCHEMA.D some other options


      For reasons I won't go in to here, i need this file sorted into the following order (note there might be less or more than 4 tables, or less or more than 3 entries per table):




      REORG TABLE SCHEMA.A
      REORG INDEXES ALL FOR TABLE SCHEMA.A
      RUNSTATS ON TABLE SCHEMA.A
      REORG TABLE SCHEMA.B
      REORG INDEXES ALL FOR TABLE SCHEMA.B
      RUNSTATS ON TABLE SCHEMA.B
      ...etc


      ie. REORG TABLES, REORG INDEX then RUNSTAT for each table in the file.



      I have tried the following (plus variants):




      sort -t. -k2 test.fil
      sort -t. -k2.1,2.8 -k1.1,1.7 test.fil


      but the issue seems to be getting the secondary sorting (REORG TABLE, REORG INDEX then RUNSTAT) working correctly.



      The first sort command above gets objects in order of descending table name, then sorted by length of k2.



      The second sort command doesn't account for the fact that TABLE comes after INDEX (T after I) in the alphabet, but that I need INDEX after Table.



      Any gurus out there that can help, muchly appreciated. Maybe there's other awk's and linux commands to use in conjunction?



      I've also been through the sort command options, maybe there's some i've missed.









      share|improve this question










      share|improve this question




      share|improve this question









      asked Jul 12 at 7:02









      dergy

      82




      82




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          Let's make an awk script that modifies your data so that it's easily sortable the way you want it to be sorted:



          BEGIN OFS = "t" # set output delimiter to a tab

          /REORG TABLE/ $0 = 1 OFS $0 # prefix line with 1 for this op.
          /REORG INDEX/ $0 = 2 OFS $0 # with 2
          /RUNSTATS/ $0 = 3 OFS $0 # with 3

          # prefix line with schema name (unconditionally)
          match($0,"SCHEMA.[^ ]*"); $0 = substr($0,RSTART,RLENGTH) OFS $0

          # output modified line
          print


          This awk script would prepend each line with two tab-separated values:



          1. The schema name, e.g. SCHEMA.A.

          2. The step that this operation happens in for this schema, which is an integer, 1, 2 or 3.

          Running it on your data:



          $ awk -f script.awk file
          SCHEMA.A 1 REORG TABLE SCHEMA.A some other options
          SCHEMA.B 1 REORG TABLE SCHEMA.B some other options
          SCHEMA.C 1 REORG TABLE SCHEMA.C some other options
          SCHEMA.D 1 REORG TABLE SCHEMA.D some other options
          SCHEMA.A 2 REORG INDEXES ALL FOR TABLE SCHEMA.A some other options
          SCHEMA.B 2 REORG INDEXES ALL FOR TABLE SCHEMA.B some other options
          SCHEMA.C 2 REORG INDEXES ALL FOR TABLE SCHEMA.C some other options
          SCHEMA.D 2 REORG INDEXES ALL FOR TABLE SCHEMA.D some other options
          SCHEMA.A 3 RUNSTATS ON TABLE SCHEMA.A some other options
          SCHEMA.B 3 RUNSTATS ON TABLE SCHEMA.B some other options
          SCHEMA.C 3 RUNSTATS ON TABLE SCHEMA.C some other options
          SCHEMA.D 3 RUNSTATS ON TABLE SCHEMA.D some other options


          What this does is making the sorting keys easier to find for sort.



          This can then be sorted and the new columns may be deleted:



          $ awk -f script.awk file | sort | cut -f 3-
          REORG TABLE SCHEMA.A some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.A some other options
          RUNSTATS ON TABLE SCHEMA.A some other options
          REORG TABLE SCHEMA.B some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.B some other options
          RUNSTATS ON TABLE SCHEMA.B some other options
          REORG TABLE SCHEMA.C some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.C some other options
          RUNSTATS ON TABLE SCHEMA.C some other options
          REORG TABLE SCHEMA.D some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.D some other options
          RUNSTATS ON TABLE SCHEMA.D some other options





          share|improve this answer























          • Works a treat! Thanks Kusalananda, you've earned a co-author's credit on the script i'm writing!
            – dergy
            Jul 12 at 23:30










          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%2f454841%2fsort-lines-in-a-file-on-2-keys-with-variable-text%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
          2
          down vote



          accepted










          Let's make an awk script that modifies your data so that it's easily sortable the way you want it to be sorted:



          BEGIN OFS = "t" # set output delimiter to a tab

          /REORG TABLE/ $0 = 1 OFS $0 # prefix line with 1 for this op.
          /REORG INDEX/ $0 = 2 OFS $0 # with 2
          /RUNSTATS/ $0 = 3 OFS $0 # with 3

          # prefix line with schema name (unconditionally)
          match($0,"SCHEMA.[^ ]*"); $0 = substr($0,RSTART,RLENGTH) OFS $0

          # output modified line
          print


          This awk script would prepend each line with two tab-separated values:



          1. The schema name, e.g. SCHEMA.A.

          2. The step that this operation happens in for this schema, which is an integer, 1, 2 or 3.

          Running it on your data:



          $ awk -f script.awk file
          SCHEMA.A 1 REORG TABLE SCHEMA.A some other options
          SCHEMA.B 1 REORG TABLE SCHEMA.B some other options
          SCHEMA.C 1 REORG TABLE SCHEMA.C some other options
          SCHEMA.D 1 REORG TABLE SCHEMA.D some other options
          SCHEMA.A 2 REORG INDEXES ALL FOR TABLE SCHEMA.A some other options
          SCHEMA.B 2 REORG INDEXES ALL FOR TABLE SCHEMA.B some other options
          SCHEMA.C 2 REORG INDEXES ALL FOR TABLE SCHEMA.C some other options
          SCHEMA.D 2 REORG INDEXES ALL FOR TABLE SCHEMA.D some other options
          SCHEMA.A 3 RUNSTATS ON TABLE SCHEMA.A some other options
          SCHEMA.B 3 RUNSTATS ON TABLE SCHEMA.B some other options
          SCHEMA.C 3 RUNSTATS ON TABLE SCHEMA.C some other options
          SCHEMA.D 3 RUNSTATS ON TABLE SCHEMA.D some other options


          What this does is making the sorting keys easier to find for sort.



          This can then be sorted and the new columns may be deleted:



          $ awk -f script.awk file | sort | cut -f 3-
          REORG TABLE SCHEMA.A some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.A some other options
          RUNSTATS ON TABLE SCHEMA.A some other options
          REORG TABLE SCHEMA.B some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.B some other options
          RUNSTATS ON TABLE SCHEMA.B some other options
          REORG TABLE SCHEMA.C some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.C some other options
          RUNSTATS ON TABLE SCHEMA.C some other options
          REORG TABLE SCHEMA.D some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.D some other options
          RUNSTATS ON TABLE SCHEMA.D some other options





          share|improve this answer























          • Works a treat! Thanks Kusalananda, you've earned a co-author's credit on the script i'm writing!
            – dergy
            Jul 12 at 23:30














          up vote
          2
          down vote



          accepted










          Let's make an awk script that modifies your data so that it's easily sortable the way you want it to be sorted:



          BEGIN OFS = "t" # set output delimiter to a tab

          /REORG TABLE/ $0 = 1 OFS $0 # prefix line with 1 for this op.
          /REORG INDEX/ $0 = 2 OFS $0 # with 2
          /RUNSTATS/ $0 = 3 OFS $0 # with 3

          # prefix line with schema name (unconditionally)
          match($0,"SCHEMA.[^ ]*"); $0 = substr($0,RSTART,RLENGTH) OFS $0

          # output modified line
          print


          This awk script would prepend each line with two tab-separated values:



          1. The schema name, e.g. SCHEMA.A.

          2. The step that this operation happens in for this schema, which is an integer, 1, 2 or 3.

          Running it on your data:



          $ awk -f script.awk file
          SCHEMA.A 1 REORG TABLE SCHEMA.A some other options
          SCHEMA.B 1 REORG TABLE SCHEMA.B some other options
          SCHEMA.C 1 REORG TABLE SCHEMA.C some other options
          SCHEMA.D 1 REORG TABLE SCHEMA.D some other options
          SCHEMA.A 2 REORG INDEXES ALL FOR TABLE SCHEMA.A some other options
          SCHEMA.B 2 REORG INDEXES ALL FOR TABLE SCHEMA.B some other options
          SCHEMA.C 2 REORG INDEXES ALL FOR TABLE SCHEMA.C some other options
          SCHEMA.D 2 REORG INDEXES ALL FOR TABLE SCHEMA.D some other options
          SCHEMA.A 3 RUNSTATS ON TABLE SCHEMA.A some other options
          SCHEMA.B 3 RUNSTATS ON TABLE SCHEMA.B some other options
          SCHEMA.C 3 RUNSTATS ON TABLE SCHEMA.C some other options
          SCHEMA.D 3 RUNSTATS ON TABLE SCHEMA.D some other options


          What this does is making the sorting keys easier to find for sort.



          This can then be sorted and the new columns may be deleted:



          $ awk -f script.awk file | sort | cut -f 3-
          REORG TABLE SCHEMA.A some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.A some other options
          RUNSTATS ON TABLE SCHEMA.A some other options
          REORG TABLE SCHEMA.B some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.B some other options
          RUNSTATS ON TABLE SCHEMA.B some other options
          REORG TABLE SCHEMA.C some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.C some other options
          RUNSTATS ON TABLE SCHEMA.C some other options
          REORG TABLE SCHEMA.D some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.D some other options
          RUNSTATS ON TABLE SCHEMA.D some other options





          share|improve this answer























          • Works a treat! Thanks Kusalananda, you've earned a co-author's credit on the script i'm writing!
            – dergy
            Jul 12 at 23:30












          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          Let's make an awk script that modifies your data so that it's easily sortable the way you want it to be sorted:



          BEGIN OFS = "t" # set output delimiter to a tab

          /REORG TABLE/ $0 = 1 OFS $0 # prefix line with 1 for this op.
          /REORG INDEX/ $0 = 2 OFS $0 # with 2
          /RUNSTATS/ $0 = 3 OFS $0 # with 3

          # prefix line with schema name (unconditionally)
          match($0,"SCHEMA.[^ ]*"); $0 = substr($0,RSTART,RLENGTH) OFS $0

          # output modified line
          print


          This awk script would prepend each line with two tab-separated values:



          1. The schema name, e.g. SCHEMA.A.

          2. The step that this operation happens in for this schema, which is an integer, 1, 2 or 3.

          Running it on your data:



          $ awk -f script.awk file
          SCHEMA.A 1 REORG TABLE SCHEMA.A some other options
          SCHEMA.B 1 REORG TABLE SCHEMA.B some other options
          SCHEMA.C 1 REORG TABLE SCHEMA.C some other options
          SCHEMA.D 1 REORG TABLE SCHEMA.D some other options
          SCHEMA.A 2 REORG INDEXES ALL FOR TABLE SCHEMA.A some other options
          SCHEMA.B 2 REORG INDEXES ALL FOR TABLE SCHEMA.B some other options
          SCHEMA.C 2 REORG INDEXES ALL FOR TABLE SCHEMA.C some other options
          SCHEMA.D 2 REORG INDEXES ALL FOR TABLE SCHEMA.D some other options
          SCHEMA.A 3 RUNSTATS ON TABLE SCHEMA.A some other options
          SCHEMA.B 3 RUNSTATS ON TABLE SCHEMA.B some other options
          SCHEMA.C 3 RUNSTATS ON TABLE SCHEMA.C some other options
          SCHEMA.D 3 RUNSTATS ON TABLE SCHEMA.D some other options


          What this does is making the sorting keys easier to find for sort.



          This can then be sorted and the new columns may be deleted:



          $ awk -f script.awk file | sort | cut -f 3-
          REORG TABLE SCHEMA.A some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.A some other options
          RUNSTATS ON TABLE SCHEMA.A some other options
          REORG TABLE SCHEMA.B some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.B some other options
          RUNSTATS ON TABLE SCHEMA.B some other options
          REORG TABLE SCHEMA.C some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.C some other options
          RUNSTATS ON TABLE SCHEMA.C some other options
          REORG TABLE SCHEMA.D some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.D some other options
          RUNSTATS ON TABLE SCHEMA.D some other options





          share|improve this answer















          Let's make an awk script that modifies your data so that it's easily sortable the way you want it to be sorted:



          BEGIN OFS = "t" # set output delimiter to a tab

          /REORG TABLE/ $0 = 1 OFS $0 # prefix line with 1 for this op.
          /REORG INDEX/ $0 = 2 OFS $0 # with 2
          /RUNSTATS/ $0 = 3 OFS $0 # with 3

          # prefix line with schema name (unconditionally)
          match($0,"SCHEMA.[^ ]*"); $0 = substr($0,RSTART,RLENGTH) OFS $0

          # output modified line
          print


          This awk script would prepend each line with two tab-separated values:



          1. The schema name, e.g. SCHEMA.A.

          2. The step that this operation happens in for this schema, which is an integer, 1, 2 or 3.

          Running it on your data:



          $ awk -f script.awk file
          SCHEMA.A 1 REORG TABLE SCHEMA.A some other options
          SCHEMA.B 1 REORG TABLE SCHEMA.B some other options
          SCHEMA.C 1 REORG TABLE SCHEMA.C some other options
          SCHEMA.D 1 REORG TABLE SCHEMA.D some other options
          SCHEMA.A 2 REORG INDEXES ALL FOR TABLE SCHEMA.A some other options
          SCHEMA.B 2 REORG INDEXES ALL FOR TABLE SCHEMA.B some other options
          SCHEMA.C 2 REORG INDEXES ALL FOR TABLE SCHEMA.C some other options
          SCHEMA.D 2 REORG INDEXES ALL FOR TABLE SCHEMA.D some other options
          SCHEMA.A 3 RUNSTATS ON TABLE SCHEMA.A some other options
          SCHEMA.B 3 RUNSTATS ON TABLE SCHEMA.B some other options
          SCHEMA.C 3 RUNSTATS ON TABLE SCHEMA.C some other options
          SCHEMA.D 3 RUNSTATS ON TABLE SCHEMA.D some other options


          What this does is making the sorting keys easier to find for sort.



          This can then be sorted and the new columns may be deleted:



          $ awk -f script.awk file | sort | cut -f 3-
          REORG TABLE SCHEMA.A some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.A some other options
          RUNSTATS ON TABLE SCHEMA.A some other options
          REORG TABLE SCHEMA.B some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.B some other options
          RUNSTATS ON TABLE SCHEMA.B some other options
          REORG TABLE SCHEMA.C some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.C some other options
          RUNSTATS ON TABLE SCHEMA.C some other options
          REORG TABLE SCHEMA.D some other options
          REORG INDEXES ALL FOR TABLE SCHEMA.D some other options
          RUNSTATS ON TABLE SCHEMA.D some other options






          share|improve this answer















          share|improve this answer



          share|improve this answer








          edited Jul 12 at 7:21


























          answered Jul 12 at 7:16









          Kusalananda

          101k13199312




          101k13199312











          • Works a treat! Thanks Kusalananda, you've earned a co-author's credit on the script i'm writing!
            – dergy
            Jul 12 at 23:30
















          • Works a treat! Thanks Kusalananda, you've earned a co-author's credit on the script i'm writing!
            – dergy
            Jul 12 at 23:30















          Works a treat! Thanks Kusalananda, you've earned a co-author's credit on the script i'm writing!
          – dergy
          Jul 12 at 23:30




          Works a treat! Thanks Kusalananda, you've earned a co-author's credit on the script i'm writing!
          – dergy
          Jul 12 at 23:30












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f454841%2fsort-lines-in-a-file-on-2-keys-with-variable-text%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

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

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?