• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

add and subtract values in xml string

Hey guys
A little programming question.  I have a fingerprint time clock that outputs to a xml file that is formatted for spreadsheets.  Problem is this.  If a person clocks in first thing in the morning and clocks out for lunch and then back in and back out at the end of the day, the Time clock puts all the time values inside one cell, or string (if you open it with Notepad).  Is there a way to take this data and calculate a total time at work for that one day?  Or am I stuck with manually calculating it up.
0
jonmenefee
Asked:
jonmenefee
  • 5
  • 3
1 Solution
 
SimonCommented:
What does the string look like in notepad?

Is it like "09:00 12:01 13:01 17:15"

Does it store the date in a separate cell?

Are there incomplete records such as
"13:00 18:01 19:04"
where someone logged in but forgot to log out at the end of their shift or worked through until after midnight?

Can you post a sample of the Excel file? It should be possible to split the values, but need to see the data we're dealing with.
0
 
jonmenefeeAuthor Commented:
Here it is.  Thanks for the help so far :-)
0
 
jonmenefeeAuthor Commented:
oops :-)
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
jonmenefeeAuthor Commented:
dang, it wont let me upload.  I will try again.
January-2015-hours.xml
0
 
SimonCommented:
Hi, it is possible to split those values to get the individual time elements, but the sample has an odd mixture of duplicated entries and unpaired values. Is this because the system is not yet live?
TimesheetXML.pngI have to query this to establish how you want to deal with the following cases:
1. Unpaired values (perhaps login but not logout or vice versa). Should this produce a zero result?
2. Odd numbers of entries (as on 9th), which also imply an unpaired login or logout
3. Multiple instances of the same time value (as on 9th) - should all but the first instance be disregarded?
0
 
jonmenefeeAuthor Commented:
how you are seeing it is how it shows up on the big report.  Turns out there is a summary report that I didn't know about.  It summarized everyones time into a grand total of hours for each person.  So, I don't need to do any programming..   thank god :-)
0
 
jonmenefeeAuthor Commented:
His questions prompted me to dig deeper into the system and I found what I was looking for.  Therefore points should go to him :-0
0
 
SimonCommented:
LOL - glad for you :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now