需要帮助来计算每位员工的工作时间 [英] Need help to calculate working hours for each employee
问题描述
亲爱的,
我有一个问题需要解决。我有一种系统安装在不同用户使用的不同PC上。每次用户登录或注销时,信息都存储在.dat文件中。
.dat文件的内容类似于:
Dear All,
I have a problem to solve. I have a kind of system installed on different pc used by different users. Each time a user logs in or logs out the information is stored in a .dat file.
The content of the .dat file is similiar to this:
No. date time username status
1 2013/08/03 0101:35.470 alb1_hig Logged out
2 2013/08/03 0101:35.470 alb8_hig Logged in
3 2013/08/03 0145:48.373 alb2_hig Logged out
4 2013/08/03 0145:48.373 alb6_hig Logged in
5 2013/08/03 0222:42.947 alb6_hig Logged out
6 2013/08/03 0222:42.947 alb2_hig Logged in
7 2013/08/03 0458:50.546 alb2_hig Logged out
8 2013/08/03 0458:50.546 alb4_hig Logged in
9 2013/08/03 0506:21.319 alb8_hig Logged out
10 2013/08/03 0506:21.319 alb3_hig Logged in
字符串之间的一些空格是简单空格,有些是制表符。 />
我想要做的是将这些信息传输到数据库表并计算一段时间内每个用户的总工作时间(每周,每月等) 。
你有什么想法从哪里开始,哪条路是我应该遵循的最佳途径?
提前谢谢你你的帮助。
克劳德。
Some of the spaces between the strings are simple spaces and some are tabs.
What I want to do is to transfer this information to a database table and to calculate the total working hours for each user within a period of time (weekly, monthly etc.).
Do you have any Idea where to start and which is the best path I should follow?
Thank you in advance for your help.
Claude.
推荐答案
出了什么问题:
What's wrong with:
- 读取文本文件的一行
- 解析收集值
- 将收集的值插入数据表
- 从步骤1开始重复文件结束。
?
解析应该是微不足道的(你甚至可以用空格替换 TAB
,然后只拆分字符串。)
?
Parsing should be trivial (you may even substitute TAB
s with blanks and then just split the string).
这篇关于需要帮助来计算每位员工的工作时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!