The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
MySQL Tuning Tools with mysqltuner.pl and tuning-primer.sh Neo Web Programming, Web 2.0 and Mashups 2 10-14-2008 09:28 AM
Searching word in a file with awk studieu Shell Programming and Scripting 3 07-09-2008 08:28 AM
Find Exactly word in grep command koti_rama UNIX for Dummies Questions & Answers 4 08-23-2007 03:52 AM
searching word in files naamas03 UNIX for Dummies Questions & Answers 2 11-06-2006 02:26 AM
Searching for key word within a file moradwan UNIX for Dummies Questions & Answers 1 03-08-2006 12:31 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 08-11-2008
Registered User
 

Join Date: Mar 2008
Posts: 6
Grepping using Perl

Hi senthilkumar_ak,

You can use Perl. It will give you better results than grep i think.
Here are few tips for searching ...
1. do not store the file contents in an array, if the file size is huge
2. loop thru using the file handle ex: while (my $line = <FILE>) {
3. to make things faster, use variables as counters. If you want to match say 5 times ... you need not have to parse the entire file in loop, exit after 5 matches using a counter var.

Regards,
Visit my Perl blog for tips on Perl,
TechDiary
Reply With Quote
Forum Sponsor
  #9  
Old 08-13-2008
Registered User
 

Join Date: Aug 2008
Location: Chennai
Posts: 25
Thanks vikas.. I am beginner in perl i will use your tips, may be i will come up with some query to you if i encountered any errors.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
grep

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:24 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0