|
Search Forums:
|
|||||||
| Forums | Register | Forum Rules | Linux and Unix Links | Man Pages | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help me using sed
Hi , I have this record as output of my script but i want it to filter more so as not to display those records/lines that has lesser than 10. here is the sample record: Code:
Feb 24 abraham 60.191.95.78 = 2 Feb 24 andrea 60.191.95.78 = 2 Feb 24 page 60.191.95.78 = 2 Feb 24 magenta 60.191.95.78 = 2 Feb 24 user 60.191.95.78 = 22 Feb 24 clemence 60.191.95.78 = 10 Feb 24 cvsroot 60.191.95.78 = 4 Feb 24 richard 210.83.161.213 = 2 Feb 24 kaitlyn 60.191.95.78 = 11 Feb 24 allan 60.191.95.78 = 2 Feb 24 guest 60.191.95.78 = 20 Feb 24 taylor 60.191.95.78 = 11 Feb 24 abigail 60.191.95.78 = 12 Feb 24 ana 60.191.95.78 = 10 Feb 24 jasmine 60.191.95.78 = 11 Feb 24 paulette 60.191.95.78 = 10 Feb 24 bind 60.191.95.78 = 2 Feb 24 squirrelmail 60.191.95.78 = 3 Feb 24 allison 60.191.95.78 = 40 Feb 24 cecile 60.191.95.78 = 20 Feb 24 nath 60.191.95.78 = 45 Feb 24 gamma 60.191.95.78 = 2 Feb 24 aaron 60.191.95.78 = 2 Feb 24 emma 60.191.95.78 = 11 Feb 24 love 60.191.95.78 = 2 Feb 24 avery 60.191.95.78 = 10 Feb 24 setup 75.73.173.60 = 2 Feb 24 joan 75.73.173.60 = 2 Feb 24 luce 60.191.95.78 = 10 Feb 24 alpha 60.191.95.78 = 2 Feb 24 chantal 60.191.95.78 = 110 Feb 24 horde 60.191.95.78 = 2 Feb 24 username 210.83.161.213 = 2 Feb 24 obelix 60.191.95.78 = 3 Feb 24 constance 60.191.95.78 = 15 Anyone can help me on this ? |
| Sponsored Links | |
|
|
|
#2
|
|||
|
|||
|
use awk: Code:
awk '$NF>=10{print}' filecheers, Devaraj Takhellambam |
| Sponsored Links | ||
|
|
|
#3
|
||||
|
||||
|
Code:
awk -F"=" '{if ( $2 <= 10 ) print $1 $2 }' filename |
|
#4
|
|||
|
|||
|
Code:
sed -n '/\=\s*[0-9][0-9][0-9]*$/p' abc.txt HTH, PL |
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
We can also do the parsing by this way.
sed -nr '/\=\s*[0-9]{2,}$/p' <inputfilename> |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
Whew,
Thanks to all. I'll appreciate all your replies. May i know how can I earn on this forum ? ![]() |
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
Did you mean learn or earn?
|
| Sponsored Links | ||
|
|