Quick awk script to parse target names

This commit is contained in:
Brandon Rhodes 2015-02-08 02:19:00 -05:00
parent 6e64e93565
commit bc8192f66a
2 changed files with 19 additions and 0 deletions

16
bin/parse_zzidmap.awk Normal file
View File

@ -0,0 +1,16 @@
BEGIN {
print "target_names = ["
}
/^ *BLTCOD/ {
n=$NF
}
/^ *BLTNAM/ {
sub("[^']*", "")
print " (" n ", " $0 "),"
}
END {
print " ]"
}

3
bin/parse_zzidmap.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
awk '/^ *BLTCOD/ {n=$NF} /^ *BLTNAM/ {sub(".*'\''", "");print}' "$@"