poniedziałek, 11 listopada 2013

How to skip every n-th byte in binary file from Linux command

Here is solution to do it from shell using 'xxd' and 'sed'.
E.g. to copy every 4th byte from binary in_file to out_file:

xxd -p -c4 in_file | sed 's/\(.\{6\}\)\(..\)/\2/g' | xxd -p -r >out_file

Brak komentarzy:

Prześlij komentarz