I have two sets of files test.csv data.xml.
I am trying to grep a specific field from test.csv and search the string in data.xml. If string is found then print the corresponding line in test.csv file.
Example
search string is field 3 server name
test.csv
111,xxx,serversugar,port90
222,yyy,servertorque,port190
333,aaa,serverastrix,port8080
422,yxy,servertorque,port290
data.xml
<group>
<hostname>servertorque</hostname>
<hostname>serverastrix</hostname></group>
Output expected
222,yyy,servertorque,port190
333,aaa,serverastrix,port8080
422,yxy,servertorque,port290