LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] [OT] perl and grep

[ILUG] [OT] perl and grep

Declan Grady Declan.Grady at nuvotem.com
Fri Mar 19 10:04:42 GMT 2004


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



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell