Operating System - HP-UX
1745886 Members
4588 Online
108723 Solutions
New Discussion

Grep a value range + evrything after it from a o/p file

 
SOLVED
Go to solution
zxcv
Super Advisor

Grep a value range + evrything after it from a o/p file

Hi ,

 

I have a o/p say

 

A 5

b 10

c 45

d 6

e 8

f 15

g 17

 

Now i want to grep all lines whose second column value is greater than 15.

The o/p should be

g 17

c 45

2 REPLIES 2
Dennis Handly
Acclaimed Contributor
Solution

Re: grep a value range + everything after it from a file

>Now I want to print all lines whose second column value is greater than 15.

awk '$2 > 15 { print $0 }' file

zxcv
Super Advisor

Re: grep a value range + everything after it from a file

Thanks Dennis again.