On Tue, 2012-01-24 at 12:30 -0800, Steve McCarthy wrote: > I'll take a swing. > > I'd modify the .* expression, which will match any character any number of > times, including zero. I would be more explicit and say that you want to > match any character other than the delimiter any number of times, followed > by the delimiter, and match the preceding group exactly 2 times. So .* > becomes [^;]* > > egrep -e '^([^;]*;){2}201110' filename.csv
Thanks for pointing that out! Checking, I did indeed get some unwanted records when I matched the "." metacharacter. -- William Kreuter, MPA, Research Consultant, 206-744-1806 Dept. of Health Services, University of Washington