Find column content from 30 files

sam2929
sam2929 used Ask the Experts™
on
Hi,
i have like 30 files
1001a_test_20110413.csv
1003a_test_20110211.csv
1004_test_20110122.csv and so on

in this file contents are
id firstname lastname email company

i am trying to find file (.csv file) which contains email aa@yahoo.com how can i find it
(As i don't know out of 30 files which file have email aa@yahoo.com)

Thanks,
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
ozo
Most Valuable Expert 2014
Top Expert 2015

Commented:
grep 'aa@yahoo.com' *.csv
Top Expert 2007

Commented:


grep -il 'aa@yahoo.com' *.csv

Open in new window

Author

Commented:
ok i have some .csv files from april 28 and some from may 14 any quick way to count how many .csv
files we have from from may 14
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Top Expert 2007
Commented:
Assuming the date is part of the filename
ls *20110514*.csv | wc -l

Open in new window

Author

Commented:
i am trying to find all files which have yahho.com records doing
grep -il '%yahoo.com%' *.csv its not giving me results
ozo
Most Valuable Expert 2014
Top Expert 2015

Commented:
Does the file contain yahho.com or %yahoo.com% ?

Author

Commented:
getting error below
 grep -il  'aa.yahoo.com' *_reg.csv
ksh: /usr/bin/grep: 0403-027 The parameter list is too long.
Top Expert 2007

Commented:
In that case, do

find . -name "*_reg.csv" grep -il 'aa.yahoo.com' {} \;

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial