Command or script to read a binary file and skip some bytes every X bytes I am trying to find an Android shell command that is able to read a file but that has the power to skip, for example 512 bytes every 1024 bytes. 

Does such a command exist and is available for Android devices?

I have looked at dd documentation but couldn't figure out if it is possible to use dd for that purpose. 
You can make dd skip bytes at the beginning of the file, you can make it read X bytes from a file, but I do not see how to get the feature that I described.

EDIT:

For my purpose the command/script should output to stdout, and the processing will read the output like a stream, so it will not be something like "cat a file, do processing, cat a file". It is like "while true; do cat a file; done | processing".

The list of available commands is here: http://www.busybox.net/downloads/BusyBox.html
You should try to use this bash script I wrote for you (require busybox on your Android):

put the script in a file called script.bash (change  with your own path) :

#!/system/xbin/bash
# sputnick 20120928 http://android.stackexchange.com/posts/30069

binfile=&lt;THE PATH OF YOUR BIN FILE&gt;
bytes=$(wc -c &lt; $binfile)
c=0 count=0

while ((count &lt; bytes - (1024+512) )); do
    dd 2&gt;/dev/null if=$binfile bs=512 count=2 skip=$c
    printf '\n\n'
    ((count += 1024+512 ))
    ((c+=3))
done


Now, in a terminal on your computer (this is for linux, adapt it if you use Windows)

adb push script.bash /mnt/sdcard/script.bash
adb shell
bash
chmod +x /mnt/sdcard/script.bash
/mnt/sdcard/script.bash


edit

This is what the script does in-fine :

dd 2&gt;/dev/null if=/tmp/bin bs=512 count=2 skip=0
dd 2&gt;/dev/null if=/tmp/bin bs=512 count=2 skip=3
dd 2&gt;/dev/null if=/tmp/bin bs=512 count=2 skip=6
dd 2&gt;/dev/null if=/tmp/bin bs=512 count=2 skip=9
(...)