I have CVS file which as search pattern and file name seperated by comma. I want to read the CVS for get search pattern and file and do grep. I tried but its not working. Any pointer in this will helpfull. Please find CSV File(DC2LOGS.csv.
SearchPattern,FilenamewithPath
-116329548,/opt/httpd/logs/apps/atasvc/prod3/was70/atasvc-59596/ata.log
-91756,/opt/httpd/logs/apps/atasvc/prod3/was70/atasvc-59596/ata.log
-86160,/opt/httpd/logs/apps/atasvc/prod3/was70/atasvc-59596/ata.log.1
Grep code:
cat DC2Logs.csv | while read a b c d e; do grep -E "CLAManager.getAttributeFromCLAMapping() took.*$d.*" < "$e"; done;
Thanks in advance.