![]() |
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 Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reading a file and writing the file name to a param file. | thebeginer | UNIX for Advanced & Expert Users | 1 | 10-05-2007 04:38 PM |
| Reading file names from a file and executing the relative file from shell script | anushilrai | Shell Programming and Scripting | 4 | 03-10-2006 05:25 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Need help on getting value from a file
I have a file which contains the data like below.It conatins more data than i posted here.
BEGIN DSJOB Identifier "TestPart" DateModified "2008-10-08" TimeModified "00.36.32" Identifier "ROOT" DateModified "1899-12-30" TimeModified "00.00.01" OLEType "CJobDefn" Readonly "0" Name "Test" NextID "1" Container "V0" JobVersion "50.0.0" ControlAfterSubr "0" MetaBag "CMetaProperty" BEGIN DSSUBRECORD BEGIN DSJOB Identifier "GetFile" DateModified "2008-10-05" Identifier "ROOT" DateModified "1899-12-30" TimeModified "00.00.01" OLEType "CJobDefn" Readonly "0" Name "Test" NextID "1" Container "V0" JobVersion "50.0.0" ControlAfterSubr "0" MetaBag "CMetaProperty" BEGIN DSSUBRECORD BEGIN DSJOB Identifier "TrimFields" DateModified "2008-10-05" Identifier "ROOT" DateModified "1899-12-30" TimeModified "00.00.01" OLEType "CJobDefn" Readonly "0" Name "Test" NextID "1" Container "V0" JobVersion "50.0.0" ControlAfterSubr "0" MetaBag "CMetaProperty" BEGIN DSSUBRECORD BEGIN DSJOB Identifier "ConvertDate" DateModified "2008-10-05" Identifier "ROOT" DateModified "1899-12-30" TimeModified "00.00.01" OLEType "CJobDefn" Readonly "0" Name "Test" NextID "1" Container "V0" JobVersion "50.0.0" ControlAfterSubr "0" MetaBag "CMetaProperty" BEGIN DSSUBRECORD BEGIN DSJOB Identifier "LoadTable" DateModified "2008-10-05" Identifier "ROOT" DateModified "1899-12-30" TimeModified "00.00.01" OLEType "CJobDefn" Readonly "0" Name "Test" NextID "1" Container "V0" JobVersion "50.0.0" ControlAfterSubr "0" MetaBag "CMetaProperty" BEGIN DSSUBRECORD BEGIN DSJOB Identifier "Test" DateModified "2008-10-05" In the above text I need to grep for "BEGIN DSJOB" and when ever i find this text i need the line after this text. Out put : Identifier "TestPart" Identifier "GetFile" Identifier "TrimFields" Identifier "ConvertDate" Identifier "LoadTable" Identifier "Test" Please give me some suggestion how can i acheive this. Thanks |
|
||||
|
Quote:
Did you mean from the file Code:
awk ' NR == 3 { print }' filename
from the output ? |