Solved

discard some lines from file

Posted on 2006-11-29
8
207 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

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 demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

830 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