$ cat /auto/atsingh5/outtest
PFLAG
-------------------------- ----- -----------
2011-06-16-08.59.38.122168 5 2050
2011-06-16-08.59.38.122168 9 2372
2011-06-16-08.59.38.122168 B 651
2011-06-16-08.59.38.122168 C 7422
2011-06-16-08.59.38.122168 D 291
2011-06-16-08.59.38.122168 P 43
2011-06-16-08.59.38.122168 S 5188
2011-06-16-08.59.38.122168 T 1085
2011-06-16-08.59.38.122168 V 691
2011-06-16-08.59.38.122168 Y 84232
10 record(s) selected.
I need the output like this
2011-06-16-08.59.38.122168
5 2050
9 2372
B 651
C 7422
D 291
P 43
S 5188
T 1085
V 691
Y 84232
bash-3.00$ cat -n /tmp/myfile
1
2 PFLAG
3 -------------------------- ----- -----------
4 2011-06-16-08.59.38.122168 5 2050
5 2011-06-16-08.59.38.122168 9 2372
6 2011-06-16-08.59.38.122168 B 651
7 2011-06-16-08.59.38.122168 C 7422
8 2011-06-16-08.59.38.122168 D 291
9 2011-06-16-08.59.38.122168 P 43
10 2011-06-16-08.59.38.122168 S 5188
11 2011-06-16-08.59.38.122168 T 1085
12 2011-06-16-08.59.38.122168 V 691
13 2011-06-16-08.59.38.122168 Y 84232
14
15
bash-3.00$ nawk '{ if (NR==4) {printf ("%s\n",$1)} if(NR>=4) {print $2,$3}}' /tmp/myfile
2011-06-16-08.59.38.122168
5 2050
9 2372
B 651
C 7422
D 291
P 43
S 5188
T 1085
V 691
Y 84232
with tab seperated
nawk '{ if (NR==4) {printf ("%s\n",$1)} if(NR>=4) {print $2"\t"$3}}' /tmp/myfile
a=" awk '/^[0-9]/{a[$1]=a[$1]"\n"$2"\t"$3}END{for (i in a) print i,a}' "
b=" db2 "select * from table" "
$b | $a
but the problem is, when I tried this I got this error
$b | $a
Syntax Error The source line is 1.
The error context is
>>> ' <<<
awk: 0602-540 There is a missing } character.
awk: 0602-500 Quitting The source line is 1.