Prev: Useful use of cat? (was Re: This Week's Useless Use of Cat Awardgoes to...)
Next: Useful use of cat? (was Re: This Week's Useless Use of Cat Award goes ?to...)
From: laredotornado on 24 Feb 2010 13:50 Hi, I'm using Mac OS 10.5.6. I want to search through a group of files and determine which files have the string "styleClass" more than once in the same line. So for example, if one file contained ... ===Begin===== Hi there Bye styleClass styleClass bye ====End===== that would satisfy the conditions, but this file ===Begin ====== Hi styleClass styleClass Bye =====End ===== would not. Thanks for your help, - Dave
From: pk on 24 Feb 2010 13:45 laredotornado wrote: > Hi, > > I'm using Mac OS 10.5.6. I want to search through a group of files > and determine which files have the string "styleClass" more than once > in the same line. So for example, if one file contained ... > > ===Begin===== > Hi there > > Bye styleClass styleClass bye > ====End===== > > that would satisfy the conditions, but this file > > ===Begin ====== > Hi > styleClass > styleClass > Bye > =====End ===== > > would not. Thanks for your help, - Dave grep 'styleClass.*styleClass' yourfile
From: pk on 24 Feb 2010 13:46 pk wrote: > grep 'styleClass.*styleClass' yourfile Ah, if you want the filenames, use "grep -l"
From: laredotornado on 24 Feb 2010 14:51
On Feb 24, 11:46 am, pk <p...(a)pk.invalid> wrote: > pk wrote: > > grep 'styleClass.*styleClass' yourfile > > Ah, if you want the filenames, use "grep -l" Once again, a 5 star answer. Thanks! |