This company we're dealing with, that's handling our phone fees, is sending us some reports on our employees' personal calls. The bad part of the story is that their programmers are inept, and they couldn't do anything better than the pathological format they send the data in. The programmers are now dead (shot out of frustration by their boss), while the handling company doesn't have the resources to comprehend their existing code to update it to something more sane.
Enough introductions. The report should contain rows of the following fields:
- T: time (e.g. 10PM, 12AM, 1PM, 8PM)
- D: duration (e.g. 12sec, 894sec, 2000sec, ...)
- N: number (e.g. +71231888, +70929112, ..)
- Y: type (only one of these: SMS, WAP, PHONECALL)
The thing is, when the type is WAP, the phone number will not be included.
11PM
12PM
9AM
11AM
20sec
30sec
10sec
0sec
+70702211
+70703311
+70112111
PHONECALL
PHONECALL
WAP
SMS
This should be interpretted as:
T1
T2
T3
T4
D1
D2
D3
D4
N1
N2
N4
Y1
Y2
Y3
Y4
The purpose of this exercise is to reorganize the data so that it looks like this
T1 D1 N1 Y1
T2 D2 N2 Y2
T3 D3 N/A Y3
T4 D4 N4 Y4