add and subtract values in xml string

Posted on 2015-02-09
Last Modified: 2015-02-11
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.
Question by:jonmenefee
  • 5
  • 3
LVL 18

Accepted Solution

SimonAdept earned 500 total points
ID: 40599597
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.

Author Comment

ID: 40599641
Here it is.  Thanks for the help so far :-)

Author Comment

ID: 40599643
oops :-)

Author Comment

ID: 40599647
dang, it wont let me upload.  I will try again.
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

LVL 18

Expert Comment

ID: 40600858
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?

Author Comment

ID: 40604479
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 :-)

Author Closing Comment

ID: 40604483
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
LVL 18

Expert Comment

ID: 40604488
LOL - glad for you :)

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In this article, I will show you HOW TO: Suppress Configuration Issues and Warnings Alert displayed in Summary status for ESXi 6.5 after enabling SSH or ESXi Shell.
Use of TCL script on Cisco devices:  - create file and merge it with running configuration to apply configuration changes
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
Viewers will learn how to create a PivotTable and make basic changes to it in Excel 2013.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now