removing digits from the end of lines in text file

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 this sample from a log file which is driving me crazy. i want to remove the last 8 digits but the problem there are colons in different places so I tried awk but it didn't work. this is the content of the file:



L258A:lp=L258:sd=LXXXK.S11:qt=text:00001000,mgfgfhghjk:09809898785
L258B:lp=L258:sd=LXXXK.S11:qt=raw:00002000lkjhgfdgfhghjk:098767894
L629A:lp=L629:sd=LXXXK.S11:qt=text:00003000oiuytyuiup:987656788903
L629B:lp=L629:sd=LXXXK.S11:qt=raw:00004000kljhkl;lkjhlk:0987656797
D206:rm=WXXBQ9Q2:rp=P11111PLD19L206DRAFT$:qt=auto:qg=107:000050009
D208:rm=WXXBQ9Q2:rp=P11111PLD19L208DRAFT$:qt=auto:qg=107:000060003
D210:rm=WXXBQ9Q2:rp=P11111PLD19L210DRAFT$:qt=auto:qg=107:000070005
D254:rm=NXXQ9QG:rp=P11111PLD19L254DRAFT$:qt=auto:qg=143:0000800047
D255:rm=NXXQ9QG:rp=P11111PLD19L255DRAFT$:qt=auto:qg=143:0000900049
D257:rm=NXXXQQG:rp=P11111PLD19L257DRAFT$:qt=auto:qg=143:0001100044
C783:rm=WXSBQ9QF:rp=P11111PLD19L783$:qt=auto:qg=139:00065000465783
C545:rm=WXSBQ9Q6:rp=P11111PLD19L545$:qt=auto:qg=133:00066000346635
C546:rm=WXSBQ9Q6:rp=P11111PLD19L546$:qt=auto:qg=133:00067000343438
C547:rm=WXSBQ9Q6:rp=P11111PLD19L547$:qt=addd:qg=133:00068000345549
C548:rm=WXSBQ9Q6:rp=P11111PLD19L548$:qt=asss:qg=133:00069000565449
C256:rm=WXSBTQ75:rp=P11111PLD19L256$:qt=auto:qg=208:jkk:0987678787
P221A:lp=P221:sd=L003K.111:qt=text:00071000asdkjasdue8:87656787906
P221B:lp=P221:sd=L003K.111:qt=raw:00072000dsfdghdfsafgg:3245667855
P301A:lp=P301:sd=L003K.111:qt=text:00073000kjhgcbvbmnlo:9098765563
P301B:lp=P301:sd=L003K.111:qt=raw:00074000poiuhgtyreewr:9876545673
TRRR:rm=AUxxxbM:rp=TRMS:cl=|writer=%f|jobn=%j:qt=cctl:000750005673


The required output like this text:



L258A:lp=L258:sd=LXXXK.S11:qt=text:00001000,mgfgfhghjk:098
L258B:lp=L258:sd=LXXXK.S11:qt=raw:00002000lkjhgfdgfhghjk:0
L629A:lp=L629:sd=LXXXK.S11:qt=text:00003000oiuytyuiup:9876
L629B:lp=L629:sd=LXXXK.S11:qt=raw:00004000kljhkl;lkjhlk:09
D206:rm=WXXBQ9Q2:rp=P11111PLD19L206DRAFT$:qt=auto:qg=107:0
D208:rm=WXXBQ9Q2:rp=P11111PLD19L208DRAFT$:qt=auto:qg=107:0
D210:rm=WXXBQ9Q2:rp=P11111PLD19L210DRAFT$:qt=auto:qg=107:0
D254:rm=NXXQ9QG:rp=P11111PLD19L254DRAFT$:qt=auto:qg=143:00
D255:rm=NXXQ9QG:rp=P11111PLD19L255DRAFT$:qt=auto:qg=143:00
D257:rm=NXXXQQG:rp=P11111PLD19L257DRAFT$:qt=auto:qg=143:00
C783:rm=WXSBQ9QF:rp=P11111PLD19L783$:qt=auto:qg=139:000650
C545:rm=WXSBQ9Q6:rp=P11111PLD19L545$:qt=auto:qg=133:000660
C546:rm=WXSBQ9Q6:rp=P11111PLD19L546$:qt=auto:qg=133:000670
C547:rm=WXSBQ9Q6:rp=P11111PLD19L547$:qt=addd:qg=133:000680
C548:rm=WXSBQ9Q6:rp=P11111PLD19L548$:qt=asss:qg=133:000690
C256:rm=WXSBTQ75:rp=P11111PLD19L256$:qt=auto:qg=208:jkk:09
P221A:lp=P221:sd=L003K.111:qt=text:00071000asdkjasdue8:876
P221B:lp=P221:sd=L003K.111:qt=raw:00072000dsfdghdfsafgg:32
P301A:lp=P301:sd=L003K.111:qt=text:00073000kjhgcbvbmnlo:90
P301B:lp=P301:sd=L003K.111:qt=raw:00074000poiuhgtyreewr:98
TRRR:rm=AUxxxbM:rp=TRMS:cl=|writer=%f|jobn=%j:qt=cctl:0007









share|improve this question









New contributor




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























    up vote
    3
    down vote

    favorite












    I have this sample from a log file which is driving me crazy. i want to remove the last 8 digits but the problem there are colons in different places so I tried awk but it didn't work. this is the content of the file:



    L258A:lp=L258:sd=LXXXK.S11:qt=text:00001000,mgfgfhghjk:09809898785
    L258B:lp=L258:sd=LXXXK.S11:qt=raw:00002000lkjhgfdgfhghjk:098767894
    L629A:lp=L629:sd=LXXXK.S11:qt=text:00003000oiuytyuiup:987656788903
    L629B:lp=L629:sd=LXXXK.S11:qt=raw:00004000kljhkl;lkjhlk:0987656797
    D206:rm=WXXBQ9Q2:rp=P11111PLD19L206DRAFT$:qt=auto:qg=107:000050009
    D208:rm=WXXBQ9Q2:rp=P11111PLD19L208DRAFT$:qt=auto:qg=107:000060003
    D210:rm=WXXBQ9Q2:rp=P11111PLD19L210DRAFT$:qt=auto:qg=107:000070005
    D254:rm=NXXQ9QG:rp=P11111PLD19L254DRAFT$:qt=auto:qg=143:0000800047
    D255:rm=NXXQ9QG:rp=P11111PLD19L255DRAFT$:qt=auto:qg=143:0000900049
    D257:rm=NXXXQQG:rp=P11111PLD19L257DRAFT$:qt=auto:qg=143:0001100044
    C783:rm=WXSBQ9QF:rp=P11111PLD19L783$:qt=auto:qg=139:00065000465783
    C545:rm=WXSBQ9Q6:rp=P11111PLD19L545$:qt=auto:qg=133:00066000346635
    C546:rm=WXSBQ9Q6:rp=P11111PLD19L546$:qt=auto:qg=133:00067000343438
    C547:rm=WXSBQ9Q6:rp=P11111PLD19L547$:qt=addd:qg=133:00068000345549
    C548:rm=WXSBQ9Q6:rp=P11111PLD19L548$:qt=asss:qg=133:00069000565449
    C256:rm=WXSBTQ75:rp=P11111PLD19L256$:qt=auto:qg=208:jkk:0987678787
    P221A:lp=P221:sd=L003K.111:qt=text:00071000asdkjasdue8:87656787906
    P221B:lp=P221:sd=L003K.111:qt=raw:00072000dsfdghdfsafgg:3245667855
    P301A:lp=P301:sd=L003K.111:qt=text:00073000kjhgcbvbmnlo:9098765563
    P301B:lp=P301:sd=L003K.111:qt=raw:00074000poiuhgtyreewr:9876545673
    TRRR:rm=AUxxxbM:rp=TRMS:cl=|writer=%f|jobn=%j:qt=cctl:000750005673


    The required output like this text:



    L258A:lp=L258:sd=LXXXK.S11:qt=text:00001000,mgfgfhghjk:098
    L258B:lp=L258:sd=LXXXK.S11:qt=raw:00002000lkjhgfdgfhghjk:0
    L629A:lp=L629:sd=LXXXK.S11:qt=text:00003000oiuytyuiup:9876
    L629B:lp=L629:sd=LXXXK.S11:qt=raw:00004000kljhkl;lkjhlk:09
    D206:rm=WXXBQ9Q2:rp=P11111PLD19L206DRAFT$:qt=auto:qg=107:0
    D208:rm=WXXBQ9Q2:rp=P11111PLD19L208DRAFT$:qt=auto:qg=107:0
    D210:rm=WXXBQ9Q2:rp=P11111PLD19L210DRAFT$:qt=auto:qg=107:0
    D254:rm=NXXQ9QG:rp=P11111PLD19L254DRAFT$:qt=auto:qg=143:00
    D255:rm=NXXQ9QG:rp=P11111PLD19L255DRAFT$:qt=auto:qg=143:00
    D257:rm=NXXXQQG:rp=P11111PLD19L257DRAFT$:qt=auto:qg=143:00
    C783:rm=WXSBQ9QF:rp=P11111PLD19L783$:qt=auto:qg=139:000650
    C545:rm=WXSBQ9Q6:rp=P11111PLD19L545$:qt=auto:qg=133:000660
    C546:rm=WXSBQ9Q6:rp=P11111PLD19L546$:qt=auto:qg=133:000670
    C547:rm=WXSBQ9Q6:rp=P11111PLD19L547$:qt=addd:qg=133:000680
    C548:rm=WXSBQ9Q6:rp=P11111PLD19L548$:qt=asss:qg=133:000690
    C256:rm=WXSBTQ75:rp=P11111PLD19L256$:qt=auto:qg=208:jkk:09
    P221A:lp=P221:sd=L003K.111:qt=text:00071000asdkjasdue8:876
    P221B:lp=P221:sd=L003K.111:qt=raw:00072000dsfdghdfsafgg:32
    P301A:lp=P301:sd=L003K.111:qt=text:00073000kjhgcbvbmnlo:90
    P301B:lp=P301:sd=L003K.111:qt=raw:00074000poiuhgtyreewr:98
    TRRR:rm=AUxxxbM:rp=TRMS:cl=|writer=%f|jobn=%j:qt=cctl:0007









    share|improve this question









    New contributor




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





















      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I have this sample from a log file which is driving me crazy. i want to remove the last 8 digits but the problem there are colons in different places so I tried awk but it didn't work. this is the content of the file:



      L258A:lp=L258:sd=LXXXK.S11:qt=text:00001000,mgfgfhghjk:09809898785
      L258B:lp=L258:sd=LXXXK.S11:qt=raw:00002000lkjhgfdgfhghjk:098767894
      L629A:lp=L629:sd=LXXXK.S11:qt=text:00003000oiuytyuiup:987656788903
      L629B:lp=L629:sd=LXXXK.S11:qt=raw:00004000kljhkl;lkjhlk:0987656797
      D206:rm=WXXBQ9Q2:rp=P11111PLD19L206DRAFT$:qt=auto:qg=107:000050009
      D208:rm=WXXBQ9Q2:rp=P11111PLD19L208DRAFT$:qt=auto:qg=107:000060003
      D210:rm=WXXBQ9Q2:rp=P11111PLD19L210DRAFT$:qt=auto:qg=107:000070005
      D254:rm=NXXQ9QG:rp=P11111PLD19L254DRAFT$:qt=auto:qg=143:0000800047
      D255:rm=NXXQ9QG:rp=P11111PLD19L255DRAFT$:qt=auto:qg=143:0000900049
      D257:rm=NXXXQQG:rp=P11111PLD19L257DRAFT$:qt=auto:qg=143:0001100044
      C783:rm=WXSBQ9QF:rp=P11111PLD19L783$:qt=auto:qg=139:00065000465783
      C545:rm=WXSBQ9Q6:rp=P11111PLD19L545$:qt=auto:qg=133:00066000346635
      C546:rm=WXSBQ9Q6:rp=P11111PLD19L546$:qt=auto:qg=133:00067000343438
      C547:rm=WXSBQ9Q6:rp=P11111PLD19L547$:qt=addd:qg=133:00068000345549
      C548:rm=WXSBQ9Q6:rp=P11111PLD19L548$:qt=asss:qg=133:00069000565449
      C256:rm=WXSBTQ75:rp=P11111PLD19L256$:qt=auto:qg=208:jkk:0987678787
      P221A:lp=P221:sd=L003K.111:qt=text:00071000asdkjasdue8:87656787906
      P221B:lp=P221:sd=L003K.111:qt=raw:00072000dsfdghdfsafgg:3245667855
      P301A:lp=P301:sd=L003K.111:qt=text:00073000kjhgcbvbmnlo:9098765563
      P301B:lp=P301:sd=L003K.111:qt=raw:00074000poiuhgtyreewr:9876545673
      TRRR:rm=AUxxxbM:rp=TRMS:cl=|writer=%f|jobn=%j:qt=cctl:000750005673


      The required output like this text:



      L258A:lp=L258:sd=LXXXK.S11:qt=text:00001000,mgfgfhghjk:098
      L258B:lp=L258:sd=LXXXK.S11:qt=raw:00002000lkjhgfdgfhghjk:0
      L629A:lp=L629:sd=LXXXK.S11:qt=text:00003000oiuytyuiup:9876
      L629B:lp=L629:sd=LXXXK.S11:qt=raw:00004000kljhkl;lkjhlk:09
      D206:rm=WXXBQ9Q2:rp=P11111PLD19L206DRAFT$:qt=auto:qg=107:0
      D208:rm=WXXBQ9Q2:rp=P11111PLD19L208DRAFT$:qt=auto:qg=107:0
      D210:rm=WXXBQ9Q2:rp=P11111PLD19L210DRAFT$:qt=auto:qg=107:0
      D254:rm=NXXQ9QG:rp=P11111PLD19L254DRAFT$:qt=auto:qg=143:00
      D255:rm=NXXQ9QG:rp=P11111PLD19L255DRAFT$:qt=auto:qg=143:00
      D257:rm=NXXXQQG:rp=P11111PLD19L257DRAFT$:qt=auto:qg=143:00
      C783:rm=WXSBQ9QF:rp=P11111PLD19L783$:qt=auto:qg=139:000650
      C545:rm=WXSBQ9Q6:rp=P11111PLD19L545$:qt=auto:qg=133:000660
      C546:rm=WXSBQ9Q6:rp=P11111PLD19L546$:qt=auto:qg=133:000670
      C547:rm=WXSBQ9Q6:rp=P11111PLD19L547$:qt=addd:qg=133:000680
      C548:rm=WXSBQ9Q6:rp=P11111PLD19L548$:qt=asss:qg=133:000690
      C256:rm=WXSBTQ75:rp=P11111PLD19L256$:qt=auto:qg=208:jkk:09
      P221A:lp=P221:sd=L003K.111:qt=text:00071000asdkjasdue8:876
      P221B:lp=P221:sd=L003K.111:qt=raw:00072000dsfdghdfsafgg:32
      P301A:lp=P301:sd=L003K.111:qt=text:00073000kjhgcbvbmnlo:90
      P301B:lp=P301:sd=L003K.111:qt=raw:00074000poiuhgtyreewr:98
      TRRR:rm=AUxxxbM:rp=TRMS:cl=|writer=%f|jobn=%j:qt=cctl:0007









      share|improve this question









      New contributor




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











      I have this sample from a log file which is driving me crazy. i want to remove the last 8 digits but the problem there are colons in different places so I tried awk but it didn't work. this is the content of the file:



      L258A:lp=L258:sd=LXXXK.S11:qt=text:00001000,mgfgfhghjk:09809898785
      L258B:lp=L258:sd=LXXXK.S11:qt=raw:00002000lkjhgfdgfhghjk:098767894
      L629A:lp=L629:sd=LXXXK.S11:qt=text:00003000oiuytyuiup:987656788903
      L629B:lp=L629:sd=LXXXK.S11:qt=raw:00004000kljhkl;lkjhlk:0987656797
      D206:rm=WXXBQ9Q2:rp=P11111PLD19L206DRAFT$:qt=auto:qg=107:000050009
      D208:rm=WXXBQ9Q2:rp=P11111PLD19L208DRAFT$:qt=auto:qg=107:000060003
      D210:rm=WXXBQ9Q2:rp=P11111PLD19L210DRAFT$:qt=auto:qg=107:000070005
      D254:rm=NXXQ9QG:rp=P11111PLD19L254DRAFT$:qt=auto:qg=143:0000800047
      D255:rm=NXXQ9QG:rp=P11111PLD19L255DRAFT$:qt=auto:qg=143:0000900049
      D257:rm=NXXXQQG:rp=P11111PLD19L257DRAFT$:qt=auto:qg=143:0001100044
      C783:rm=WXSBQ9QF:rp=P11111PLD19L783$:qt=auto:qg=139:00065000465783
      C545:rm=WXSBQ9Q6:rp=P11111PLD19L545$:qt=auto:qg=133:00066000346635
      C546:rm=WXSBQ9Q6:rp=P11111PLD19L546$:qt=auto:qg=133:00067000343438
      C547:rm=WXSBQ9Q6:rp=P11111PLD19L547$:qt=addd:qg=133:00068000345549
      C548:rm=WXSBQ9Q6:rp=P11111PLD19L548$:qt=asss:qg=133:00069000565449
      C256:rm=WXSBTQ75:rp=P11111PLD19L256$:qt=auto:qg=208:jkk:0987678787
      P221A:lp=P221:sd=L003K.111:qt=text:00071000asdkjasdue8:87656787906
      P221B:lp=P221:sd=L003K.111:qt=raw:00072000dsfdghdfsafgg:3245667855
      P301A:lp=P301:sd=L003K.111:qt=text:00073000kjhgcbvbmnlo:9098765563
      P301B:lp=P301:sd=L003K.111:qt=raw:00074000poiuhgtyreewr:9876545673
      TRRR:rm=AUxxxbM:rp=TRMS:cl=|writer=%f|jobn=%j:qt=cctl:000750005673


      The required output like this text:



      L258A:lp=L258:sd=LXXXK.S11:qt=text:00001000,mgfgfhghjk:098
      L258B:lp=L258:sd=LXXXK.S11:qt=raw:00002000lkjhgfdgfhghjk:0
      L629A:lp=L629:sd=LXXXK.S11:qt=text:00003000oiuytyuiup:9876
      L629B:lp=L629:sd=LXXXK.S11:qt=raw:00004000kljhkl;lkjhlk:09
      D206:rm=WXXBQ9Q2:rp=P11111PLD19L206DRAFT$:qt=auto:qg=107:0
      D208:rm=WXXBQ9Q2:rp=P11111PLD19L208DRAFT$:qt=auto:qg=107:0
      D210:rm=WXXBQ9Q2:rp=P11111PLD19L210DRAFT$:qt=auto:qg=107:0
      D254:rm=NXXQ9QG:rp=P11111PLD19L254DRAFT$:qt=auto:qg=143:00
      D255:rm=NXXQ9QG:rp=P11111PLD19L255DRAFT$:qt=auto:qg=143:00
      D257:rm=NXXXQQG:rp=P11111PLD19L257DRAFT$:qt=auto:qg=143:00
      C783:rm=WXSBQ9QF:rp=P11111PLD19L783$:qt=auto:qg=139:000650
      C545:rm=WXSBQ9Q6:rp=P11111PLD19L545$:qt=auto:qg=133:000660
      C546:rm=WXSBQ9Q6:rp=P11111PLD19L546$:qt=auto:qg=133:000670
      C547:rm=WXSBQ9Q6:rp=P11111PLD19L547$:qt=addd:qg=133:000680
      C548:rm=WXSBQ9Q6:rp=P11111PLD19L548$:qt=asss:qg=133:000690
      C256:rm=WXSBTQ75:rp=P11111PLD19L256$:qt=auto:qg=208:jkk:09
      P221A:lp=P221:sd=L003K.111:qt=text:00071000asdkjasdue8:876
      P221B:lp=P221:sd=L003K.111:qt=raw:00072000dsfdghdfsafgg:32
      P301A:lp=P301:sd=L003K.111:qt=text:00073000kjhgcbvbmnlo:90
      P301B:lp=P301:sd=L003K.111:qt=raw:00074000poiuhgtyreewr:98
      TRRR:rm=AUxxxbM:rp=TRMS:cl=|writer=%f|jobn=%j:qt=cctl:0007






      bash






      share|improve this question









      New contributor




      Ben 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




      Ben 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








      edited 1 hour ago









      Rui F Ribeiro

      37.1k1273118




      37.1k1273118






      New contributor




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









      asked 5 hours ago









      Ben

      183




      183




      New contributor




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





      New contributor





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






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




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          I would use sed for this task:



          sed 's/.8$//' file





          share|improve this answer




















          • if not enough 8 digits in end, then this will delete other characters too
            – sddgob
            1 hour ago

















          up vote
          2
          down vote













          You can use colrm from util-linux



          colrm 59 < file





          share|improve this answer




















          • Would you please explain the command in your answer. what does 59 do?
            – sddgob
            1 hour ago











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



          );






          Ben 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%2f475213%2fremoving-digits-from-the-end-of-lines-in-text-file%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
          2
          down vote



          accepted










          I would use sed for this task:



          sed 's/.8$//' file





          share|improve this answer




















          • if not enough 8 digits in end, then this will delete other characters too
            – sddgob
            1 hour ago














          up vote
          2
          down vote



          accepted










          I would use sed for this task:



          sed 's/.8$//' file





          share|improve this answer




















          • if not enough 8 digits in end, then this will delete other characters too
            – sddgob
            1 hour ago












          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          I would use sed for this task:



          sed 's/.8$//' file





          share|improve this answer












          I would use sed for this task:



          sed 's/.8$//' file






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 5 hours ago









          Goro

          8,91864486




          8,91864486











          • if not enough 8 digits in end, then this will delete other characters too
            – sddgob
            1 hour ago
















          • if not enough 8 digits in end, then this will delete other characters too
            – sddgob
            1 hour ago















          if not enough 8 digits in end, then this will delete other characters too
          – sddgob
          1 hour ago




          if not enough 8 digits in end, then this will delete other characters too
          – sddgob
          1 hour ago












          up vote
          2
          down vote













          You can use colrm from util-linux



          colrm 59 < file





          share|improve this answer




















          • Would you please explain the command in your answer. what does 59 do?
            – sddgob
            1 hour ago















          up vote
          2
          down vote













          You can use colrm from util-linux



          colrm 59 < file





          share|improve this answer




















          • Would you please explain the command in your answer. what does 59 do?
            – sddgob
            1 hour ago













          up vote
          2
          down vote










          up vote
          2
          down vote









          You can use colrm from util-linux



          colrm 59 < file





          share|improve this answer












          You can use colrm from util-linux



          colrm 59 < file






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 5 hours ago









          Steven Penny

          2,36621635




          2,36621635











          • Would you please explain the command in your answer. what does 59 do?
            – sddgob
            1 hour ago

















          • Would you please explain the command in your answer. what does 59 do?
            – sddgob
            1 hour ago
















          Would you please explain the command in your answer. what does 59 do?
          – sddgob
          1 hour ago





          Would you please explain the command in your answer. what does 59 do?
          – sddgob
          1 hour ago











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









           

          draft saved


          draft discarded


















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












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











          Ben 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%2f475213%2fremoving-digits-from-the-end-of-lines-in-text-file%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          List of Gilmore Girls characters

          One-line joke