Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Need to fetch only selected data in CSV

$
0
0
Hi Team,
I m getting my script commands output like given below


Code:

[ U-UU-YRYT-NOD-6002 ] GETA-TILL-INF;
 
  U-UU-YRYT-NOD-6002 2015-05-14 THU 19:44:10
  C2221 RETRIEVE TILL INFORMATION : COMPLD
  ----------------------------------------------------------------------
  CONNECT_CARD_ID  CONNECT_PORT_ID  DDE_ID  ANT_ID_INSTALL_ID  TILT
  ----------------------------------------------------------------------
  0                  0                0        1                  75 
  0                  1                0        1                  65 
  0                  2                0        1                  25
  ----------------------------------------------------------------------
  COUNT = 3
;


I need to convert this output in csv like given below..


Code:

U-UU-YRYT-NOD-6002 75
U-UU-YRYT-NOD-6002 65
U-UU-YRYT-NOD-6002 25



I m using follwing script but not working

Code:

cmd_sys NOD_$y GETA-TILL-INF | grep "-" | awk -F' ' '{print$1}' | head -2 | tail -1 > /home/lotus/lotus/temp1.txt
cmd_sys NOD_$y GETA-TILL-INF | head -3 | tail -3 | awk -F' ' '{print$2}' >> /home/lotus/output/temp1.txt


Viewing all articles
Browse latest Browse all 16232

Trending Articles