![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| grep command | christine33990 | UNIX for Dummies Questions & Answers | 11 | 05-06-2008 02:45 AM |
| how to exclude the GREP command from GREP | yamsin789 | UNIX for Advanced & Expert Users | 2 | 10-05-2007 02:59 AM |
| grep command help | ishmael^soyuz | Shell Programming and Scripting | 4 | 07-11-2007 09:01 AM |
| grep command | pmsuper | UNIX for Dummies Questions & Answers | 6 | 11-22-2006 07:12 AM |
| grep command | debasis.mishra | Shell Programming and Scripting | 1 | 03-28-2006 01:53 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | 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 |
|
||||
|
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 04:47 PM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|