On Friday 19 March 2004 09:53, Niall O Broin wrote:
> On Friday 19 March 2004, Declan.Grady at nuvotem.com (Declan Grady) wrote:
> >
> >I thought of opening every sdy file and checking for the word
> > ACKNOWLEDGMENT in the specific line number where it would appear, but I
> > think this would be overkill - mabye not, as I guess grep would open
> > every file anyway ?
>> Yes, you do need to open every file but it's not overkill - how else could
> you examine their contents? But you definitely don't use system("grep ..)
> from within perl - perl was designed as a text processing language, and a
> superset of grep and awk. You could wrap your existing perl code in
> something like this
<snippety snip>
OK, good.
In the meantime I checked on the time thing.
Using grep from the command line took over 3 minutes, and a perl script to
open each sdy and check line number 5 for the words took 19 seconds !
Thanks for the help
Declan
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!