Skip to content
Snippets Groups Projects
Commit a7c15510 authored by am0ebe's avatar am0ebe
Browse files

unknowntags.sh: print infos to tags and detection (total,known,unknown) or...

unknowntags.sh: print infos to tags and detection (total,known,unknown) or print list of all unknown tags
parent 1ceef8a3
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
if (( $# < 1 )); then if (( $# < 1 )); then
echo "Print number of unique unknowntags" echo "Usage:"
echo "Usage: $0 ./block-I/02-inspect/dataFile" echo "1. Print Tag/Detection-Info"
echo "$0 ./block-I/02-inspect/dataFile"
echo ""
echo "2. Print list of unknown tags"
echo "$0 ./block-I/02-inspect/dataFile list"
exit exit
fi fi
grep X $1 | cut -d',' -f8 | sort | uniq | wc -l COL_TAG=9
HEADER_SIZE=`grep "#" "$1" | wc -l`
function printList(){
echo "Unknown Tags VVV"
grep -v '#' "$1" | cut -d',' -f"$COL_TAG"- "$1" | grep "NA" | cut -d',' -f1 | sort | uniq
echo "Unknown Tags /\\/\\"
}
# if (( "$#" < 2 )); then function printInfo() {
# echo "Usage: this data.csv newtagFile" echo "## Tags"
# echo "1. searches for unkown tags ('X') and saves them in a list named unknownTags" tag_total=`cut -d',' -f"$COL_TAG" "$1" | sort | uniq | wc -l`
# echo "2. compares these tags, with the tags from tagFile" tag_total=$(($tag_total-$HEADER_SIZE))
# echo "If anything matches, the beetle/tag must've been in the unit!" tag_known=`cut -d',' -f"$COL_TAG"- "$1" | grep -v "NA" | cut -d',' -f1 | sort | uniq | wc -l`
# exit 1 tag_unknown=$(($tag_total-$tag_known))
# fi
echo " total: $tag_total"
# while IFS= read -r line echo " known: $tag_known"
# do echo "unknown: $tag_unknown"
# grep "$line" $unknownTags echo ""
# done < "$2"
echo "## Detections"
detection_total=`wc -l "$1" | cut -d" " -f1`
detection_total=$(($detection_total-$HEADER_SIZE))
detection_known=`cut -d',' -f"$COL_TAG"- "$1" | grep -v "NA" | cut -d',' -f1 | wc -l`
detection_unknown=$(($detection_total-$detection_known))
echo " total: $detection_total"
echo " known: $detection_known"
echo "unknown: $detection_unknown"
}
if (( $# == 1 )); then
printInfo $1
else
printList $1
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment