windperl has asked for the wisdom of the Perl Monks concerning the following question:
"CLLI","SWREL","RPTDATE","RPTIME","TZ","RPTTYPE","RPTPD","IVALDATE","I +VALSTART","IVALEND","NUMENTIDS">
"STATUS","TT","GTTPERFD","GTTUN0NS","GTTUN1NT","AGTTPERFD" "K","0",0,0,0,0 "K","1",0,0,0,0 "K","2",0,0,0,0 "K","3",0,0,0,0 "K","4",0,0,0,0 "K","5",0,0,0,0 "K","6",0,0,0,0 "K","7",0,0,0,0 I have to take the IVALDATE, IVALSTART and IVALEND values from the second line which in this case are 2009-11-13, 18:45:00 and 19:00:00 respectively. And then all the values in the below part. My desired output for the above input is (tab seperated fields)-"toroonxn0dw","EAGLE5 40.1.0-62.13.19","2009-11-13","19:00:23","EST ", +"STP SYSTEM TOTAL MEASUREMENTS ON TT","LAST","2009-11-13","18:45:00", +"19:00:00",256
2009-11-13 18:45:00 19:00:00 K 0 0 0 0 0 2009-11-13 18:45:00 19:00:00 K 1 0 0 0 0 2009-11-13 18:45:00 19:00:00 K 2 0 0 0 0 2009-11-13 18:45:00 19:00:00 K 3 0 0 0 0 2009-11-13 18:45:00 19:00:00 K 4 0 0 0 0 2009-11-13 18:45:00 19:00:00 K 5 0 0 0 0 2009-11-13 18:45:00 19:00:00 K 6 0 0 0 0 2009-11-13 18:45:00 19:00:00 K 7 0 0 0 0 The header line must come only once, e.g. from one file only. For all other files it would do all the things except putting the header again. Can anybody help me in this regard with a Perl script?Date StartTime EndTime STATUS TT GTTPERFD GTTUN0NS + GTTUN1NT AGTTPERFD
Thanks, Windperl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need help to parse a csv file
by keszler (Priest) on Nov 17, 2009 at 21:14 UTC | |
|
Re: Need help to parse a csv file
by zwon (Abbot) on Nov 17, 2009 at 21:11 UTC | |
|
Re: Need help to parse a csv file
by Tux (Canon) on Nov 18, 2009 at 07:31 UTC | |
|
Re: Need help to parse a csv file
by VinsWorldcom (Prior) on Nov 17, 2009 at 21:25 UTC | |
|
Re: Need help to parse a csv file
by przemo (Scribe) on Nov 17, 2009 at 21:30 UTC | |
by Anonymous Monk on Nov 17, 2009 at 23:35 UTC | |
by przemo (Scribe) on Nov 18, 2009 at 12:51 UTC | |
by Anonymous Monk on Nov 19, 2009 at 10:18 UTC | |
by przemo (Scribe) on Nov 19, 2009 at 15:10 UTC | |
|