Inverse Grep


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Inverse Grep
# 1  
Old 06-02-2012
Inverse Grep

Hi,
I'm trying to wtite a script which actually print the text which doesn't contain a word , i mean to say.
eg:- if a file contains the follwoing data

Hello how ru ???
What ru doing ?
what is the % of data contained ???

I want to write a script such that it prints the line excluding "%" symbol

If i use grep -v "%" , it prints all lines except the matched pattern i dont want that to be Smilie
# 2  
Old 06-02-2012
So you want to replace the '%' with nothing ?

Look at tr or sed, it should be fairly simple.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How do I generate a script with an inverse action?

I have an interactive script which sorts and processes a variety of filetypes from an unsorted folder into newly created directories. The script works great, But I was wondering how I could generate a script with an inverse action so that I could unwind / undo the executed script and its sorting... (3 Replies)
Discussion started by: Braveheart
3 Replies

2. Programming

Python re.findall inverse Match

I ask of you but yet another simplistic question that I hope can be answered. Its better explained showing my code. Here is my list(tmp_pkglist), which contains a list of all Debian (Jessie) packages: snippet 'zssh (1.5c.debian.1-3.2+b1 , 1.5c.debian.1-3.2 )', 'zsync (0.6.2-1)', 'ztex-bmp... (2 Replies)
Discussion started by: metallica1973
2 Replies

3. Shell Programming and Scripting

Grep -v (inverse matching)

I am totally unexperienced in writing scripts of any kind. I am working on Mac OS X and would like to run a shell script to find files in a directory that do not conform to a specific naming convention and print to a text file in the same directory. For example, I have a folder called... (9 Replies)
Discussion started by: j_alicea
9 Replies

4. Shell Programming and Scripting

Inverse of Cut

Hi List, I have a CSV file which I am manipulating. Each time I receive the CSV for processing, there will be extra columns of data. Here's what I want to do; I want to be able to remove specific columns from the CSV data file, but keep the remaining columns, where the remaining columns are... (3 Replies)
Discussion started by: landossa
3 Replies

5. Shell Programming and Scripting

Perl - quick inverse of a number range

Hello, I'm trying to find an nice solution for the following: 1) I have ranges of numbers (begin-end): 10-15, 20-30, 45-50 2) I have begin limit=0 and end limit=60. 3) I need to find out number ranges between begin limit and end limit that do not overlap with the ranges in item1. In this... (6 Replies)
Discussion started by: pn8830
6 Replies

6. UNIX for Dummies Questions & Answers

inverse remove command

Hi All, Is there an option for 'rm' to "remove everything but these files"? For instance if I have: a.txt <-- I just want to remove this one a_1.txt a_2.txt Is there an option ? for this: rm -? *_*.txt Thanks, ScKaSx (4 Replies)
Discussion started by: ScKaSx
4 Replies

7. Shell Programming and Scripting

matrix inverse (awk)

I need to inverse a matrix given in a file. The problem is I'm stuck with writing determinant finding algoritm into code. I found this algoritm about finding determinant of nxn matrix. This is what i need: Matrices and Determinants and here: a11 a12 a13 a21 a22 a23 a31 a32 a33... (0 Replies)
Discussion started by: vesyyr
0 Replies

8. UNIX for Dummies Questions & Answers

need help-matrix inverse (awk)

I have few days to complete my awk homework. But I'm stucked. i hope some1 will help me out. I have to inverse n x n matrix, but I have problems with finding the determinant of the matrix. I found the algoritm, how to find a determinant of n x n matrix:... (0 Replies)
Discussion started by: vesyyr
0 Replies

9. UNIX for Dummies Questions & Answers

Inverse Video

I am trying to discover the sequence of escape characters that I need to pass ksh in order to turn inverse video on and off. I need this information for two reasons: * I want to include inverse video text in some shell scripts * I wish to highlight a section of an /etc/motd file Thanks for... (2 Replies)
Discussion started by: sam_pointer
2 Replies
Login or Register to Ask a Question