I want to delete initial N bytes of a file using sed.
How can I do that?
sed 's/^\(.\)\{11\}//g' forsed
This would help in deleting 11 bytes from the begining of a line, i assume u are not working on binary(I fear about endian issues).
This one is a generic u can adapt to your need, like for a line or more or specific line etc.
I am not whether this is what u require
Hope this helps
Regards,
RUV
Thanks Rakesh..
I'm not working with binary, so I believe this will help.
Wishes
Jay
sed 's/^\(.\)\{11\}//g' forsed
will delete the first 11 characters from each line
sed '1s/^\(.\)\{11\}//g' forsed
will delete the first 11 characters from the first line but the first line must contain 11 or more characters
Ignoring line boundaries will be hard using sed. To ignore line boundaries and simply delete the first n characters you might want to consider switching to dd.