Hello,
I have several xml files from which I want to find and return a particular string
I want to locate the InId="00000008". Now that is inlcuded within a tag and ofcourse the number is different every time
this is what I came up with given that after greping the line that contains the InId it is placed always fourth with spaces seperating the information.
ls $1 | grep 'ANI*' > list
while read line
do
grep 'inID="' $line | cut -d ' ' -f4 > tmp
InvID=`grep 'inID="' tmp`
echo $line " ---- " $InvID
done < list
this worked fine outputing the filename and the inID until I found out several of the files did not inlcude the inID at the fourth place but somwhere else.
I need to find a way to grep that "inID=" and the following 8 character ID no matter their position in the file
I tried grep -A 9 which should return "inID="00000008" but it seems AIX does not support -A for grep.
Any ideas how to do this? either in awk or sed or other way
many thanks in advance