Last active
January 8, 2022 17:38
-
-
Save shmerl/9df260cfa157c2c86772 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source="$1" | |
source_size=$(stat -c %s "$source") | |
offsets=( $(grep --only-matching --byte-offset --binary --text Creative "$source" | cut -d : -f 1) ) | |
# setting the last offset to the size of the file | |
offsets[${#offsets[@]}]=$source_size | |
for ((i = 0; i < $(( ${#offsets[@]} - 1 )); i++)); do | |
left=${offsets[$i]} | |
right=${offsets[$((i+1))]} | |
dd skip=$left count=$(($right - $left)) if=$source of=${source%.*}_${i}.voc bs=1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment