?
Solved

discard some lines from file

Posted on 2006-11-29
8
Medium Priority
?
213 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_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 51

Accepted Solution

by:
ahoffmann earned 80 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month10 days, 23 hours left to enroll

770 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