Solved

discard some lines from file

Posted on 2006-11-29
8
205 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

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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