Write a PERL script that will take read an input file in CSV format, manipulate the data, and then output 2 files. The first output file will be in CSV format, and the second file will be a series of SQL insert statements for a predefined table.
Input file layout:
Subscriber TN (10 Char)
Subscriber First Name (15 Char)
Subscriber Last Name (30 Char)
Date/Time of Call Start (TimeStamp)
Date/Time of Call End (TimeStamp)
TN Subscriber Called (10 Char)
Subscriber Called in Network (1 Char) – Y or N ( Y = Subscriber in Same Network)
####
Read each record in.
If Subscriber Network = N , output to File #1, else Output to File #2.
Calculate length of Call.
####
Subscriber TN
Length of Call (Integer in seconds)
TN Subscriber Called
####
Subscriber TN (10 Char)
Subscriber First Name (15 Char)
Subscriber Last Name (30 Char)
Length of Call (Integer in seconds)
TN Subscriber Called (10 Char)