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