Advertisement

09.22.2005 at 06:22AM PDT, ID: 21570430
[x]
Attachment Details

simple question... match term1 AND term2

Asked by nriddock in Perl Programming Language

i have a file containing a directory listing of files from my web server. i am trying to search for all .html files with with any reference to 2005. (ie: grep htm AND 2005
)

ive tried "grep ... htm|2005" and it seems to be returning htm OR 2005 but not instances where both terms occur in the same line

ie:
----------------------------------------------------------------------------------
-rwxrwxrwx|1|u11111|webuser||8002|Apr|1|2005|user_email.html
-rwxrwxrwx|1|u11111|webuser||6903|Dec|22|2003|user_enhancement.html
-rwxrwxrwx|1|u11111|webuser||3990|Oct|1|2005|user_questions.html
-rwxrwxrwx|1|u11111|ittecsvc|11115|May|21|2004|use_setup.html
-rw-rw-r--|1|u11111|webuser|11106|Jun|14|2005|user_setup_0614.html
-rwxrwxrwx|1|u11111|webuser||886|Jun|24|2005|user_setup_thanks.html
-rwxrwxrwx|1|u11111|webuser||6389|May|12|2003|global_user.html
-rwxrwxrwx|1|u11111|webuser||1563|Dec|5|2005|questions_user.html
-rwxrwxrwx|1|u11111|webuser||1731|Dec|5|2002|questions_info.html
-rwxrwxrwx|1|u11111|webuser||1663|Dec|5|2005|questions_program.html
-rwxrwxrwx|1|u11111|webuser||1859|Dec|5|2002|questions_train.html
-rwxrwxrwx|1|u11111|webuser||6342|Sep|24|2005|queue_setup.html

so in the above example my desired results would be:
-----------------------------------------------------------------------------
-rwxrwxrwx|1|u11111|webuser||8002|Apr|1|2005|user_email.html
-rwxrwxrwx|1|u11111|webuser||3990|Oct|1|2005|user_questions.html
-rw-rw-r--|1|u11111|webuser|11106|Jun|14|2005|user_setup_0614.html
-rwxrwxrwx|1|u11111|webuser||886|Jun|24|2005|user_setup_thanks.html
-rwxrwxrwx|1|u11111|webuser||1563|Dec|5|2005|questions_user.html
-rwxrwxrwx|1|u11111|webuser||1663|Dec|5|2005|questions_program.html
-rwxrwxrwx|1|u11111|webuser||6342|Sep|24|2005|queue_setup.html

does this make sense...any suggestions

ThanksStart Free Trial
 
Loading Advertisement...
 
[+][-]09.22.2005 at 06:49AM PDT, ID: 14936606

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.22.2005 at 07:41AM PDT, ID: 14937119

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Sign Up Now!
Solution Provided By: HonorGod
Participating Experts: 3
Solution Grade: A
 
 
[+][-]09.22.2005 at 08:03AM PDT, ID: 14937352

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09.22.2005 at 08:08AM PDT, ID: 14937390

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09.22.2005 at 10:00AM PDT, ID: 14938389

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32