|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
grep with multiple patterns with multiple arguments
Hi everyone, Very new to Unix so forgive my ignorance. So I have a bunch of prf files that we'll call *.prf and I want to sort them two different ways. I can currently sort them each way individually but would like to do both types of sorting at the same time. I'd like to find all the *.prf files that have "MD" greater than 10 and that have "Signal" containing "e-" and a value greater than 6. I can currently do each of these individually like so Code:
grep MD *.prf | egrep -v " 0\." | egrep -v " 1\." | egrep -v " 2\." | egrep -v " 3\." | egrep -v " 4\." | egrep -v " 5\." | egrep -v " 6\." | egrep -v " 7\." | egrep -v " 8\." | egrep -v " 9\." (MD example formats " 123.45", " 0.00" ) and Code:
grep Signal *.prf | grep "e\-" | egrep -v "~0\." | egrep -v "~1\." egrep -v "~2\." | egrep -v "~3\." | egrep -v "~4\." | egrep -v "~5\." (Signal example formats "12e-3" with "(~3.7 sigma)", "5e9" with "(~24.2 sigma)") I can do one or the other but there is over lap and I don't want that. Is there any way of combining these two commands? I've tried a few ways but nothing seems to work and no one else seems to have this particular question. example file list (all have e-) file1.prf has MD 4 and signal 15 file2.prf has MD 60 and signal 20 file3.prf has MD 70 and signal 3 the MD search would give me file2 and file3 the Signal search would give me file1 and file2 I only want file2 All help appreciated Thanks |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
You code is complex. Please post example section(s) of a .prf file that has the data you are looking to work with, Signal and MD.
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Code:
[jmadden@comp ~/jm]$ more file1.prf # Input file = file.fil # Reduced chi-sqr = 4.727 # Prob(Signal) < 0.0297 (~1.9 sigma) # Best MD = 56.454 # P_topo (ms) = 2.21413916910783 +/- 3.94e-06 ###################################################### 0 1.578978e+07 1 1.578103e+07 here is another Code:
[jmadden@comp ~/jm]$ more file2.prf # Input file = file.fil # Reduced chi-sqr = 2.599 # Prob(Signal) < 6.98e-08 (~5.3 sigma) # Best MD = 121.480 # P_topo (ms) = 43.2898389399925 +/- 0.00016 ###################################################### 0 734199.9 1 735387.6 2 735713 3 734675.8 4 735038.9 5 735823.4 6 735662.8 these are just sections but you can see here that file 1 and 2 would get through the MD search but not the Signal search using the MD search gives Code:
file1.prf:# Best MD = 121.480 file2.prf:# Best MD = 56.454 Signal search example output Code:
file3.prf:# Prob(Signal) < 3.6e-53 (~15.3 sigma) file4.prf:# Prob(Signal) < 4.15e-18 (~8.6 sigma) |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| grep for multiple patterns | tene | Shell Programming and Scripting | 10 | 12-01-2009 02:26 PM |
| To grep multiple patterns with space in between them...... | prashantshukla | Shell Programming and Scripting | 5 | 09-10-2008 01:25 PM |
| Grep for Multiple patterns | WillImm123 | Shell Programming and Scripting | 7 | 03-01-2006 03:23 PM |
| Grep multiple patterns | malaymaru | Shell Programming and Scripting | 4 | 09-25-2005 01:20 AM |
| grep for multiple patterns | tselvanin | UNIX for Dummies Questions & Answers | 1 | 11-12-2003 06:43 PM |
|
|