remove first two bytes every row of file

Clash 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
shell
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.
add a comment |Â
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
shell
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.
add a comment |Â
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
shell
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
shell
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.
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.
add a comment |Â
add a comment |Â
active
oldest
votes
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password