Hi Friends, I have a file. the content is as below:
file1:
/A/B/C/abc.txt
2013-07-28 13:50:00,2013-07-31 01:00:00,5,710
/A/B/C/xyz.txt
2011-09-21 18:30:00,2013-07-30 06:15:00,15,65135
2009-11-09 18:00:00,2011-09-02 09:00:00,5,12345
2013-07-28 13:50:00,2013-07-31 01:00:00,5,710
Now I have to search the pattern "2013-07-28" in the file /A/B/C/abc.txt and the patterns "2011-09-21","2011-09-21" and "2013-07-28" in the file /A/B/C/xyz.txt The patterns are below the file name..
then my output would be like:
/A/B/C/abc.txt 2013-07-28 13:50:00,2013-07-31 01:00:00,5,710,searched pattern
/A/B/C/xyz.txt 2011-09-21 18:30:00,2013-07-30 06:15:00,15,65135,searched pattern
2009-11-09 18:00:00,2011-09-02 09:00:00,5,12345,searched pattern 2013-07-28 13:50:00,2013-07-31 01:00:00,5,710,searched pattern
how to grep the pattern in the file whose name is in the same file where the pattern exists?????