grep searching interval


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting grep searching interval
# 1  
Old 03-10-2011
grep searching interval

Hi all,
I just want to find all values that are in a specified interval. I tryed it with
Code:
grep e-[18-17] file

, it does not work.

Is it possible to get values wich are lower a special number, like
Code:
grep >e-18 file

?

Thanks a lot
# 2  
Old 03-10-2011
Post the input file and the desired output.
# 3  
Old 03-10-2011
input
Code:
0.4604        7.088    5.351e-10
0.536        8.395    1.612e-12
-0.5311       -8.208     3.72e-12
0.7112        8.725    3.685e-17
0.4604        7.088    5.351e-18
0.536        8.395    1.612e-19
-0.5311       -8.208     3.72e-17
0.7112        8.725    3.685e-13

Code:
grep e-[18-17] test.txt

output
Code:
0.4604        7.088    5.351e-10
0.536        8.395    1.612e-12
-0.5311       -8.208     3.72e-12
0.7112        8.725    3.685e-17
0.4604        7.088    5.351e-18
0.536        8.395    1.612e-19
-0.5311       -8.208     3.72e-17
0.7112        8.725    3.685e-13

# 4  
Old 03-10-2011
Do you need to grep the records containing e-17 and e-18?

Code:
grep e-1[78] test.txt

# 5  
Old 03-10-2011
it works, thanks!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Insert Text after searching via grep

Hi Team, I have a file with the following patterns: ==> xyz_Server_Started_with_Errors <== errors. ==> abc_Server_Started_with_Errors <== errors ==> reds_Server_Started_with_Errors <== errorss I want them in this format: (5 Replies)
Discussion started by: ankur328
5 Replies

2. Shell Programming and Scripting

Searching for exact match using grep

I am searching for an exact match on a value read from another file to lookup an email address in another file. The file being checked is called "contacts" and it has Act #, email address, and contact person. 1693;abc1693@yahoo.comt;Tommy D 6423;abc6423@yahoo.comt;Jim Doran... (2 Replies)
Discussion started by: ziggy6
2 Replies

3. Shell Programming and Scripting

Searching for multiple patters using grep

i have a file as below grepfile.txt ---------------- RNTO command successful No such file or directory Authentication failed if i seach individually for 'RNTO command successful' or 'No such file or directory' using grep -i as below, im gettting result. grep -i 'No such file or... (5 Replies)
Discussion started by: JSKOBS
5 Replies

4. Shell Programming and Scripting

dynamic string searching for grep

hi my code is something like count=0 echo "oracle TABLESPACE NAME nd TARGET" while do count=`expr $count + 1` (1) tts_space_name$count=`echo $tts | cut -d "," -f$count` (2) target$count=grep $(tts_space_name$count)... (2 Replies)
Discussion started by: Gl@)!aTor
2 Replies

5. Shell Programming and Scripting

grep searching

I am making a script but having little problem. at one part I need to find one number format or other format from a file.. those formats are xxx-xx-xxxx or xxxxxxxxx i tried grep '( \{3\}-\{2\}-\{3\} |\{9\})' if i do them sepratly it work but like this it is not working Please check... (7 Replies)
Discussion started by: Learnerabc
7 Replies

6. Shell Programming and Scripting

searching fileextentions (suffix) with grep and/or test

Hello, I have a problem. I will search files on fileextentions (suffix). It can with the command find, but I will do it with the commands grep and/or test. When i start the script I will see all files with that extention (suffix). Can anyone help me, please? Thanks! Regards, Arjan... (4 Replies)
Discussion started by: arjanengbers
4 Replies

7. Shell Programming and Scripting

compare the interval of 2 numbers of input2with interval of several numbers of input1

Help plz Does any one have any idea how to compare interval ranges of 2 files. finding 1-4 (1,2,3,4) of input2 in input1 of same key "a" values (5-10, 30-40, 45-60, 80-90, 100-120 ). Obviously 1-4 is not one of the range with in input1 a. so it should give out of range. finding 30-33(31,32,33)... (1 Reply)
Discussion started by: repinementer
1 Replies

8. Shell Programming and Scripting

searching using grep command

Hi, i have a file called alert_pindb.log i need to grep and count for all the lines starting with "ORA-" but i need to exclude the line which is having "ORA-00600 " i am using following syntax to count the ORA- nos "grep \"ORA-\" alert_pindb.log | wc -l"; since ORA- may be anything... (9 Replies)
Discussion started by: prakash.gr
9 Replies

9. Shell Programming and Scripting

GREP Searching for a newbie...

Hi, I really need some help with GREP searching... I need to find all occurances of a file reference and remove two characters from the end of the reference. For example, here are a few lines showing the text: <image file="STRAIGHT_004CR.jpg" ALT="STRAIGHT_004CR.jpg" /> <image... (8 Replies)
Discussion started by: steveglevin
8 Replies

10. Shell Programming and Scripting

grep - searching for a specific string

ppl, this is my "file" with fields orderno orderdate orderdesc telno street city 1 01/04/2006 abc 123 100 tampa 2 01/04/2006 abc 123 100 tampa 3 01/04/2006 abc 123 100 tampa 4 01/04/2006 abc ... (2 Replies)
Discussion started by: manthasirisha
2 Replies
Login or Register to Ask a Question