Solved

discard some lines from file

Posted on 2006-11-29
8
201 Views
Last Modified: 2010-04-22
i want discard some lines from file, despite of the case sensitive

so let's take as example
these 3 terms
"file created in"
"author"
and
"first statement"
these lines can contain other things than this expression
so how have i to do to change the file and let only lines which don't contain theses expression with awk program

thanks for ur help


0
Comment
Question by:laes_
  • 3
  • 3
8 Comments
 
LVL 2

Author Comment

by:laes_
ID: 18037621

a have tried this, but i don't know why i it doesn't work!?

tolower($0) !~ /^*file created in*/ && tolower($0) !~ /^*first statement*/  && tolower($0) !~ /^*author*/ { print }
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 18037740
egrep -i -v '(file created in|author|first statement)' file
0
 
LVL 2

Author Comment

by:laes_
ID: 18037749
and with awk, could u tell me how?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 51

Accepted Solution

by:
ahoffmann earned 20 total points
ID: 18038036
awk '/[AaUuTtHhOoRr]/{next}/[FfIiLlEe CcRrEeAaTtEeDd IiNn]/{next}{print}' file
0
 
LVL 2

Author Comment

by:laes_
ID: 18038393
ahoffmann,
its an exercice that the teacher gives us , she demands us to use awk and either tolower or toupper



0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 18040250
man gawk

http:/help.jsp#hi56 homework
http:/help.jsp#hi130 homework

BTW, you initial code works if you use proper brackets ;-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now