Solved

add and subtract values in xml string

Posted on 2015-02-09
8
122 Views
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.
0
Comment
Question by:jonmenefee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 18

Accepted Solution

by:
Simon 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.
0
 

Author Comment

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

Author Comment

by:jonmenefee
ID: 40599643
oops :-)
0
[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

 

Author Comment

by:jonmenefee
ID: 40599647
dang, it wont let me upload.  I will try again.
January-2015-hours.xml
0
 
LVL 18

Expert Comment

by:Simon
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?
0
 

Author Comment

by:jonmenefee
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 :-)
0
 

Author Closing Comment

by:jonmenefee
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
0
 
LVL 18

Expert Comment

by:Simon
ID: 40604488
LOL - glad for you :)
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
: Microsoft Office Collaborate for free and online versions of Microsoft  Word, Excel, Powerpoint, OneNote, Onedrive , Email, Calendar etc. In short we can say that Microsoft office is a suite of servers, applications and services developed by  Micr…
Viewers will learn the different options available in the Backstage view in Excel 2013.
Video by: Zack
Viewers will learn about using Excel in a browser with Excel Online.

751 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