![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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 | Thread Starter | Forum | Replies | Last Post |
| grep command | christine33990 | UNIX for Dummies Questions & Answers | 11 | 05-05-2008 11:45 PM |
| how to exclude the GREP command from GREP | yamsin789 | UNIX for Advanced & Expert Users | 2 | 10-04-2007 11:59 PM |
| grep command help | ishmael^soyuz | Shell Programming and Scripting | 4 | 07-11-2007 06:01 AM |
| grep command | pmsuper | UNIX for Dummies Questions & Answers | 6 | 11-22-2006 03:12 AM |
| grep command | debasis.mishra | Shell Programming and Scripting | 1 | 03-27-2006 10:53 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
grep command help
Hello, im trying to grep the first 3 lines(starting with ERROR) from an output report and put it in a separate file... any help would be appreciated. Below is the message contained in the report
ERROR >Invalid basic data (CMOFCT-5070) Cusip: 05950XAL0 CMO#508039 Tra# 11 rec# 175 Firts Int Pay Date: 1061110 Bond type flag: V Floater type Flag: 3 Floater Reset Start Date: 0 Floater Reset Frequency: 0 thanks |
| Forum Sponsor | ||
|
|
|
|||
|
Give this a try,
grep -n "^ERROR" /tmp/err | head -3 INPUT: HTML Code:
cat /tmp/err ERROR:Quota exceeded MISC DEBUG WARNING ERROR FAULT ERROR DEBUG ERROR ERROR TYPE 1 SEVERE ERROR ERROR EXITING HTML Code:
1:ERROR:Quota exceeded 5:ERROR 8:ERROR TYPE Nagarajan Ganesan. |
|
|||
|
Hi thanks for the help.. unfortunately it didnt work.. maybe im explainin it wrong... i am running a file and it spits out an output file r.(filename) and in that output file it has several messages... im lookin to take out the first 3 lines of messages that start with ERROR and put it into another file named geek... thanks
Last edited by geekeezoid; 04-12-2007 at 01:47 PM. |
| Thread Tools | |
| Display Modes | |
|
|