Sponsored Content
Full Discussion: Grep for a range of numbers?
Top Forums UNIX for Dummies Questions & Answers Grep for a range of numbers? Post 302769275 by bakunin on Monday 11th of February 2013 06:47:02 PM
Old 02-11-2013
Contrary to the venerable Dons assumption i suppose the field 4 is the number you want to analyze. If i get you correctly your requirement is:

1. only lines with field3="chr3" as Don already mentioned
2. The value of field 4 is in the mentioned range

Is that correct?

I suggest you explain your problem with a bit more detail, because your enthusiasm in explaining what you are after is generally directly proportional to our enthusiasm in providing the desired answer. This is a fundamental truth in computer science, known as the "dialectic of goodwill".

bakunin
This User Gave Thanks to bakunin For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep numbers range

I want to grep a range of numbers in a log file. My log file looks like this: 20050807070609Z;blah blah That is a combination of yr,month,date,hours,minutes,seconds. I want to search in the log file events that happened between a particular time. like between 20050807070000 to 20050822070000... (1 Reply)
Discussion started by: azmathshaikh
1 Replies

2. UNIX for Dummies Questions & Answers

Using grep on a range of numbers

Hi im new to unix and need to find a way to grep the top 5 numbers in a file and put them into another file. For example my file looks like this abcdef 50000 abcdef 45000 abcdef 40000 abcdef 35000 abcdef 30000 abcdef 25000 abcdef 20000 abcdef 15000 abcdef 10000 and so on... How can... (1 Reply)
Discussion started by: ProgChick2oo9
1 Replies

3. Shell Programming and Scripting

read numbers from file and output which numbers belongs to which range

Howdy experts, We have some ranges of number which belongs to particual group as below. GroupNo StartRange EndRange Group0125 935300 935399 Group2006 935400 935476 937430 937459 Group0324 935477 935549 ... (6 Replies)
Discussion started by: thepurple
6 Replies

4. UNIX for Dummies Questions & Answers

List-to-Range of Numbers

Hello, I have two columns with data that look like this: Col1 Col2 ------ ----- a 1 a 2 a 3 a 4 a 7 a 8 a 9 a 10 a 11 b 6 b 7 b 8 b 9 b 14 (5 Replies)
Discussion started by: Gussifinknottle
5 Replies

5. UNIX for Dummies Questions & Answers

Frequency of a range of numbers

Hello, I have a column where there are values from 1 to 150. I want to get the frequency of values in the following ranges: 1-5 6-10 11-15 .... .... .... 146-150 How can I do this in a for loop? Thanks, Guss (1 Reply)
Discussion started by: Gussifinknottle
1 Replies

6. UNIX for Dummies Questions & Answers

How to count how many numbers in a certain range?

Hi I have a data file with two columns which looks like: 1 42 2 40 3 55 4 50 5 38 6 49 7 33 8 46 9 39 10 33 11 33 12 26 13 46 14 44 15 55 16 54 17 30 18 32 (7 Replies)
Discussion started by: marhuu
7 Replies

7. Shell Programming and Scripting

Closest Number from a Range of Numbers

out of a range of numbers, how can i pick out the number that is the closest to any arbitrary/random number that a user supplies? say the range of numbers are between 1 - 90000. but that doesn't mean each number exist between 1 - 90000. the range of numbers could be for example: 1, 3, 4, 6,... (6 Replies)
Discussion started by: SkySmart
6 Replies

8. Shell Programming and Scripting

grep for a range of numbers

Dear Friends, I want to know how to grep for the lines that has a number between given range(start and end). I have tried the following sed command. sed -n -e '/20030101011442/,/20030101035519/p' However this requires both start and end to be part of the content being grepped. However... (4 Replies)
Discussion started by: tamil.pamaran
4 Replies

9. Shell Programming and Scripting

Match on a range of numbers

Hi, I'm trying to match a filename that could be called anything from vout001 to vout252 and was trying to do a small test but I'm not getting the result I thought I would.. Can some one tell me what I'm doing wrong? *****@********>echo $mynumber ... (4 Replies)
Discussion started by: Jazmania
4 Replies

10. Shell Programming and Scripting

Print range of numbers

Hi I am getting an argument which specifies the range of numbers. eg: 7-15 Is there a way that i can easily (avoiding loop) print the range of number between and including the specified above. The above example should translate to 7,8,9,10,11,12,13,14,15 (3 Replies)
Discussion started by: tostay2003
3 Replies
SNIFFIT(5)							File Formats Manual							SNIFFIT(5)

NAME
sniffit - configuration file for sniffit (name arbirtary) DESCRIPTION
This page describes the format for the config file for sniffit (see sniffit(8) ). This file allows you to specify in great detail witch packets should be processed by sniffit. This file also controls (or will control) some functions for the continuous logging ('-L' option). A sniffit config file might look like (Be sure to end it with a BLANK line): # Sniffit Sample Config file -- Brecht Claerhout logfile /var/log/sniffit.today.log # First select all packets! select both mhosts 1 select both mhosts 2 # Now deselect all packets from/to those damn 'surfers' deselect both port 80 deselect both port 8001 This file will tell sniffit to process all packets on the subnet except those FROM/TO ports 80 and 8001 (thus we don't want logs of those mass WWW connections witch turn our logs unreadable). GLOBAL FORMAT
The file consists of lines, lines are formed by fields, fields are separated with SPACES (NO TABS). Unix comment lines (starting with '#' are allowed). So this gives us: <field1> <field2> <field3> <field4> <field5> FIELD FORMAT
<field1> select - Sniffit will look for packets that match the following description (other fields) deselect - Sniffit will ignore packets that match the description logfile - change the logfile name to <field2> instead of the default 'sniffit.log' <field2> from - Packets FROM the host matching the following desc. are considered. to - similar, Packets TO the.... both - similar, Packets FROM or TO the.... a filename - as an argument of 'logfile' in <field1> <field3> host - The (de)selection criteria involves a hostname. port - similar, ... a portnumber mhosts - The (de)selection criteria involves multiple-hosts, like with the wildcars in 0.3.0, but without the 'x' <field4> Either a hostname, a portnumber, a service name or a numbet-dot partial notation indicating multiple hosts depending on <field3> (service names like 'ftp' are resolved as the services available present on the host that runs Sniffit, and translated into a port nr) <field5> A portnumber, if <field3> was 'host' or 'mhosts' (optional, if not filled in, all ports are going to be (de)selected) FILE INTERPRETING
The config file is interpreted SEQUENTIAL, so watch it, don't mix lines in a file. Example: select both mhosts 100.100.12. deselect both port 80 select both host 100.100.12.2 This file will get you the packets: a) Send by hosts '100.100.12.*' b) EXCEPT the WWW packets c) BUT showing the WWW packets concerning 100.100.12.2 select both mhosts 100.100.12. select both host 100.100.12.2 deselect both port 80 Will give you the packets (probably unwanted result): a) Send by hosts '100.100.12.*' b) Send from/to 100.100.12.2 (useless line) c) deselecting all WWW packets on the subnet AUTHOR
Brecht Claerhout <coder@reptile.rug.ac.be> SEE ALSO
sniffit(8) SNIFFIT(5)
All times are GMT -4. The time now is 09:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy