Advertisement

12.16.2001 at 07:34AM PST, ID: 20246606
[x]
Attachment Details

Delete entire line if "word" id found

Asked by MatthewF in Perl Programming Language

Tags: delete, line, word, entire, found

I a file with over 1000 lines. I want to delete an entire line if I find a certain word on it, "word".  I'm fairly new to perl. In unix shell i would just:

g/word/d

What is the sytax in perl?

ThanksStart Free Trial
[+][-]12.16.2001 at 09:37AM PST, ID: 6679837

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
Tags: delete, line, word, entire, found
Sign Up Now!
Solution Provided By: jbrugman
Participating Experts: 2
Solution Grade: A
 
 
[+][-]12.16.2001 at 09:40AM PST, ID: 6679840

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.

 
[+][-]12.16.2001 at 09:42AM PST, ID: 6679841

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.

 
[+][-]12.16.2001 at 10:05AM PST, ID: 6679855

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.

 
[+][-]12.16.2001 at 12:23PM PST, ID: 6679949

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.

 
[+][-]12.16.2001 at 12:25PM PST, ID: 6679952

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.

 
[+][-]12.16.2001 at 07:48PM PST, ID: 6680235

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.

 
[+][-]12.17.2001 at 07:49AM PST, ID: 6681055

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