matze77 has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks!

I want to calculate the time spent on several tasks, source file is a csv or excel sheet with:

Date;Name;Subject;Minutes; 01.02.2011;Name ;XXX 01.02.2011 (MH) Server Reboot after installing ne +w Controller Software e.g. Checked Logfiles ... 15:45-17:30
1. column: Date
2. column: name
3. column: Subject
4. column should be: spent time (empty now, this should be calculated)

So i have to calculate hh:mm-hh:mm from the 3. column and add a 4. column containing the results(105 minutes in the above example)

Calculated Result should look like:
Date;Name;Subject;Minutes; 01.02.2011;Name ;XXX 01.02.2011 (MH) Server Reboot after installing ne +w Controller Software e.g. Checked Logfiles ... 15:45-17:30;105;
Any hints how to do start over?
I think its easier to work with the .csv than to mess with Win32::OLE?

Thanks
MH

Replies are listed 'Best First'.
Re: Calculate time from excel/csv file?
by samarzone (Pilgrim) on Feb 22, 2011 at 15:01 UTC

    Have a look on Text::CSV, perlre and DateTime

    Find the third column of your csv file, use regular expression to extract the starting and ending date time and find the difference between times.

    --
    Regards
    - Samar