Created
October 11, 2016 02:04
-
-
Save protosam/3e6633a8cc6148b32301a9040a3cac4d 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 | |
echo Parsing .dek file: $1 | |
echo | |
echo | |
echo Mainboard: | |
grep false $1 | tr '"' ' ' | cut -d'=' -f3,5 | awk -F'Sideboard=' '{print $1" "$2}' | sed -e 's:/>::g' | awk 'BEGIN{TOTAL=0}{print $0; TOTAL+=$1}END{print TOTAL" cards"}' | |
echo | |
echo | |
echo Sideboard: | |
grep true $1 | tr '"' ' ' | cut -d'=' -f3,5 | awk -F'Sideboard=' '{print $1" "$2}' | sed -e 's:/>::g' | awk 'BEGIN{TOTAL=0}{print $0; TOTAL+=$1}END{print TOTAL" cards"}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment