![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-19-2007 09:52 PM |
| "sed" to check file size & echo " " to destination file | jockey007 | Shell Programming and Scripting | 6 | 11-13-2007 05:00 PM |
| Need info:"talk,write and wall" | mr.anilbabu | UNIX for Dummies Questions & Answers | 1 | 07-23-2006 01:27 AM |
| how do I dump "info ls" to a file? | james hanley | UNIX for Dummies Questions & Answers | 4 | 07-05-2006 06:36 AM |
| Filtering/Finding a "Fortune" message | oldtrash | Shell Programming and Scripting | 4 | 05-13-2005 04:16 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Help, filtering some info. from a file under "()"
I HAVE A FILE "TEXT.TXT" WHICH CONTAINS FOLLOWING :
CHANNEL(SYSTEM.DEF.CLUSRCVR) CHLTYPE(CLUSRCVR) CHANNEL(TO.XYZ) CHLTYPE(CLUSRCVR) NOW I WANT THE NAMES WRITTEN BETWEEN THE BRACES () UNDER COLUMN ONE, THAT IS, TO.XYZ and SYSTEM.DEF.CLUSRCVR. USING awk i can get the first column, but then how to proceed further ? I am doing like this : sed -n '/CHANNEL/p' TEST.TXT | awk '{print $1 ;}' | tr '()' ' ' | awk '{print $2;}' | tr ')' ' ' And it does the objective , but i want something more presize and good option !! ASAP Any help, genius ?? Thanks !! |
| Forum Sponsor | ||
|
|
|
|||
|
Hey thanks for your reply !!
Its giving statements within the braces(), BUT it gives something more then that too. Its given below : $ awk '{print $2}' FS="[()]" text.txt ---------------------------------- C * SYSTEM.DEF.CLUSRCVR TO.EAIDVBR1 ---------------------------------- under "---" O/P is like shown above, more blank lines, C, * Don't know from where its being generated ? Please if you can rectify this ?? Thanks !! |
|
|||
|
Quote:
CHANNEL(TO.EAIDVBR1) CHLTYPE(CLUSRCVR) i HAVE THIS MUCH ONLY IN A FILE. |
|
|||
|
Quote:
Can you please check the hint given by you only, once again...!! I have given the Contents already of the file that i am using. Can you please help me in that ? Please check it !! |