Syntactic Confectionery Delight | |
PerlMonks |
processing columns of textby sitnalta (Initiate) |
on Feb 26, 2007 at 20:08 UTC ( [id://602207]=perlquestion: print w/replies, xml ) | Need Help?? |
sitnalta has asked for the wisdom of the Perl Monks concerning the following question:
Hello everyone, I am graphing data with gnuplot and need to convert the incremental numbers I pull with my script to reflect the difference between the given day and the day before. So 02/03/2007 needs to subtract columns 3-6 with the same column numbers from 02/02/2007. Here is how the data looks that I pulled: 02/02/2007 00:00:00 719267027 719244316 719233953 719240015 02/03/2007 00:00:00 720375777 720336674 720325633 720329849 02/04/2007 00:00:00 721640280 721640267 721522690 721552815 02/05/2007 00:00:00 722297206 722297203 722297203 722297206 And here is how im trying to get the data to look: 02/03/2007 00:00:00 1108750 1092358 1091680 1089834 02/04/2007 00:00:00 1264503 1303593 1197057 1222966 02/05/2007 00:00:00 656926 656936 774513 744391 As you can see im just subtracting one day against the other to pull the difference. Thats all I want but im not sure how to go about this with perl. I am able to do it in bash but its so ugly that I decided to attempt to learn how its done in perl. I would like to see how people will go about doing this and learn something from there expertise. This data is in a flat file and I am having trouble even getting off the ground on howto approach such a thing without using temp files. Thanks in advance!
Back to
Seekers of Perl Wisdom
|
|