![]() |
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 |
| extract and format information from a file | sujoy101 | Shell Programming and Scripting | 12 | 04-16-2008 07:58 AM |
| How to extract a piece of information from a huge file | Marcor | Shell Programming and Scripting | 2 | 03-13-2008 04:33 PM |
| I need a ton of information.... | markforsythe | AIX | 1 | 08-02-2004 10:17 AM |
| NEED Some Information!!! | btx | High Level Programming | 1 | 01-25-2004 06:50 PM |
| How do you extract the information from a library? | mercz | Shell Programming and Scripting | 3 | 09-12-2002 10:18 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
AWK to extract information
Hi all,
I am working on a shell script to extract information from a file that has output from Oracle sqlplus. The problem is that the output of a single line is spread across multiple lines and i do not know as how to extract the particular filed at ones,which spans multiple lines. Following is what the file looks like from which i am trying to extract information. DB1 Jack_ Harris_ Anderson Godwin DB2 Rich Rick DB3 Rice Paul DB4 Paul_ Darren_ Keith Gough As you can see from the file above, the output is skewed. In the first line the second column has name Jack_Anderson, which is divided in to two lines and there is a blank line between row1 and row 2. My question is how can i extract the individual fields. For eg: the AWK $2 on first line should give me Jack_Anderson (but it only gives Jack_) and $NR==2 is a blank line, how can i eliminate this blank line in the search? I am using AWK to extract the required fields, can anyone shed light on this. I am writing this in KORN shell. Thanks, Harris |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|