I am using a Bash script to use awk to look for this: (0010,0080) The awk will generally look for any numeric value seperated by a comma in between parenthesis. I have done everything I can think of and still can't get ANY results when I append it to a text file). My regex is:
awk '/\([0-9]{4},[0-9]{4}\)/' dcmResults.txt >> ~/export/"$1"/tagResults.txt
I have done almost every variation of using an escape character for the parenthesis including not using any and I get NO results when appending to a text file. Can someone please tell me what I am doing wrong?
UPDATE, here is what the whole script looks like:
#!/bin/bash
echo "Enter SUID: "
read uid
echo "Enter Tag Number: "
read dicomTag
dicomDump() {
arg1=$1
cd ~/export/"$1"
dcmdump *.dcm > ~/export/"$1"/dcmResults.txt
}
tagFinder() {
arg1=$1
arg2=$2
for i in $(cat ~/export/"$1"/dcmResults.txt); do
grep "$2" | awk '/[0-9]{4},[0-9]{4}.*/' dcmResults.txt >> ~/export/"$1"/tagResults.txt
break
done;
}
dicomDump "$uid"
tagFinder "$uid" "$dicomTag"