Link to home
Start Free TrialLog in
Avatar of laes_
laes_

asked on

discard some lines from file

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


Avatar of laes_
laes_

ASKER


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 }
egrep -i -v '(file created in|author|first statement)' file
Avatar of laes_

ASKER

and with awk, could u tell me how?
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of laes_

ASKER

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



man gawk

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

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