hello experts,
I need a sed command that remove last 10 characters of a line start from 3rd line.
any suggestions?
Thanks you
hello experts,
I need a sed command that remove last 10 characters of a line start from 3rd line.
any suggestions?
Thanks you
Last 10? or start from? Proper grammar would help here.
Remove last ten characters on all lines from the third through the end:
sed '3,$s/..........$//'
Coping with lines with fewer than ten characters left as a desperate follow-up question with incomplete sentences and weird terminology. You're welcome.
say I have a line:
blablabla
blablabla
asdfasdf0123456789
asdfasdf0123456789
I want the out put to be:
blablabla
blablabla
asdfasdf
asdfasdf
thank you
And the stuff about the third line was just to confuse the enemy? Did you try the script I posted? You can probably adapt it if it doesn't do exactly what you mean.
hehehe
sorry, I meant
a file:
blablabla
blablabla
blablabla
asdfasdf0123456789
asdfasdf0123456789
output:
blablabla
blablabla
blablabla
asdfasdf
asdfasdf
You didn't try the script, and are unable or unwilling to make a trivial modification to it?
I got the remove last 10 line part, but starting from 3rd line doesn't work for me.
It starts on the third line, or are you claiming otherwise? Making it start on the fourth is meant here as an intellectual exercise.