![]() |
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 |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| extraction of last but one char | hidnana | Shell Programming and Scripting | 5 | 02-14-2008 08:22 AM |
| AWK extraction | harris2107 | Shell Programming and Scripting | 2 | 01-15-2008 11:44 AM |
| Help with tar extraction! | manthasirisha | Shell Programming and Scripting | 4 | 03-17-2006 07:17 AM |
| extraction from a tape | big123456 | UNIX for Advanced & Expert Users | 4 | 10-25-2005 04:34 AM |
| help on file extraction | apalex | UNIX for Dummies Questions & Answers | 1 | 05-01-2001 10:29 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
AWK extraction
Hi all,
Can anyone please help me in parsing the following file. Suppose the file is called, example.lst, and has the following content in it. (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (Host = 192.168.2.2) (Port = 1525) ) ) (CONNECT_DATA = (SID = TESTDB1) ) ) (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (Host = 192.168.2.4) (Port = 1525) ) ) (CONNECT_DATA = (SID = TESTDB2) ) ) I want to extract only the value of all Host (i.e, 192.168.2.4, 192.168.2.2) and value of all SID (i.e., TESTDB1, TESTDB2) from this file. Depending on the number of HOST and SID present in the file, i want to assign them to arrays, like host[1]=192.168.2.2 host[2]=192.168.2.4 sid[1]=TESTDB1 sid[2]=TESTDB2 and so on.... I am trying this script in Korn shell. I am working with AWK. Any help would be greatly appreciated. Thanks, Harris |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|