scusi revised this gist 10 months ago. Go to revision
No changes
scusi revised this gist 10 months ago. Go to revision
No changes
Florian Walther revised this gist 11 years ago. Go to revision
1 file changed, 5 insertions, 1 deletion
ConvertBinaryBpjmData.sh
| @@ -1,6 +1,10 @@ | |||
| 1 | 1 | #!/bin/sh | |
| 2 | + | # | |
| 3 | + | # USAGE: | |
| 4 | + | # $> ./ConvertBinaryBpjmData.sh bpjm.data | |
| 5 | + | # | |
| 2 | 6 | ||
| 3 | - | RAWFILE=./bpjm.data | |
| 7 | + | RAWFILE=$1 | |
| 4 | 8 | OUTFILE=`strings $RAWFILE | head -n 1` | |
| 5 | 9 | ||
| 6 | 10 | od -t x1 -An -j 64 $RAWFILE | tr -d '\n ' > $OUTFILE | |
Florian Walther revised this gist 11 years ago. Go to revision
1 file changed, 10 insertions
ConvertBinaryBpjmData.sh(file created)
| @@ -0,0 +1,10 @@ | |||
| 1 | + | #!/bin/sh | |
| 2 | + | ||
| 3 | + | RAWFILE=./bpjm.data | |
| 4 | + | OUTFILE=`strings $RAWFILE | head -n 1` | |
| 5 | + | ||
| 6 | + | od -t x1 -An -j 64 $RAWFILE | tr -d '\n ' > $OUTFILE | |
| 7 | + | sed -i -e 's/.\{66\}/&\n/g' $OUTFILE | |
| 8 | + | sed -i 's/.\{32\}/& /' $OUTFILE | |
| 9 | + | sed -i 's/.\{65\}/& /' $OUTFILE | |
| 10 | + | echo "$OUTFILE written" | |