remove first two bytes every row of file

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 a file that has 2 bytes of binary indicator values in every row that has to be stripped off.



I tried sed, awk, cut but none of them work (though they work in vi mode)



sed 's/^.,2//' file.dat
awk 'print substr($0,3)' file
cut -c3- file



Exammple -



row 1: <84>^cColumn1,Column2
row 2: x^CColumn1,Column2
row 3: v^CColumn1,Column2
row 4: <81>^CColumn1,Column2



Desired Output -
row 1: Column1,Column2
row 2: Column1,Column2
row 3: Column1,Column2
row 4: Column1,Column2



Note - row numbers are not in file that is for better understanding described herein.



Thank You









share







New contributor




ranjan 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 a file that has 2 bytes of binary indicator values in every row that has to be stripped off.



    I tried sed, awk, cut but none of them work (though they work in vi mode)



    sed 's/^.,2//' file.dat
    awk 'print substr($0,3)' file
    cut -c3- file



    Exammple -



    row 1: <84>^cColumn1,Column2
    row 2: x^CColumn1,Column2
    row 3: v^CColumn1,Column2
    row 4: <81>^CColumn1,Column2



    Desired Output -
    row 1: Column1,Column2
    row 2: Column1,Column2
    row 3: Column1,Column2
    row 4: Column1,Column2



    Note - row numbers are not in file that is for better understanding described herein.



    Thank You









    share







    New contributor




    ranjan 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 a file that has 2 bytes of binary indicator values in every row that has to be stripped off.



      I tried sed, awk, cut but none of them work (though they work in vi mode)



      sed 's/^.,2//' file.dat
      awk 'print substr($0,3)' file
      cut -c3- file



      Exammple -



      row 1: <84>^cColumn1,Column2
      row 2: x^CColumn1,Column2
      row 3: v^CColumn1,Column2
      row 4: <81>^CColumn1,Column2



      Desired Output -
      row 1: Column1,Column2
      row 2: Column1,Column2
      row 3: Column1,Column2
      row 4: Column1,Column2



      Note - row numbers are not in file that is for better understanding described herein.



      Thank You









      share







      New contributor




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











      I have a file that has 2 bytes of binary indicator values in every row that has to be stripped off.



      I tried sed, awk, cut but none of them work (though they work in vi mode)



      sed 's/^.,2//' file.dat
      awk 'print substr($0,3)' file
      cut -c3- file



      Exammple -



      row 1: <84>^cColumn1,Column2
      row 2: x^CColumn1,Column2
      row 3: v^CColumn1,Column2
      row 4: <81>^CColumn1,Column2



      Desired Output -
      row 1: Column1,Column2
      row 2: Column1,Column2
      row 3: Column1,Column2
      row 4: Column1,Column2



      Note - row numbers are not in file that is for better understanding described herein.



      Thank You







      shell





      share







      New contributor




      ranjan 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




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








      share



      share






      New contributor




      ranjan 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









      ranjan

      1




      1




      New contributor




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





      New contributor





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






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



          );






          ranjan 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%2f476392%2fremove-first-two-bytes-every-row-of-file%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








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









           

          draft saved


          draft discarded


















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












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











          ranjan 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%2f476392%2fremove-first-two-bytes-every-row-of-file%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)