============
BEFORE I BEGIN, ALLOW ME TO SAY THANKS FOR ANY HELP THAT CAN BE PROVIDED.
============
Here is what I've been trying to figure out. Lets say in a file I have these lines, amoung others, but these would be on individual lines by themselves:
USER1234 (06/21/2012 02:34:59 PM EST)
XYZ1 (06/21/2012 03:38:14 PM EST)
ABCD (06/22/2012 06:45:05 AM EST)
What I want to do, is for the lines to become:
USER1234 (2012_06_21 1434:59 HOURS ET)
XYZ1 (2012_06_21 1538:14 HOURS ET)
ABCD (2012_06_21 0645:05 HOURS ET)
The hours, minutes and seconds will always be two digits (e.g. "06" instead of "6"). So I want to detect the "AM" or "PM" and convert the hour into the 24-hour clock, while at the same time, removing the ":" between the hour/minute, and change the EST to ET. On that I'd be using this for, it will always display EST or EDT (or maybe EDST).
The usenames can be of any length 1-30 characters, but the time zone will always be EST, EDT or EDST. The only way I can think of is to have two if statements first to find the "AM" or "PM", then within that IF statement eliminate the "AM" or "PM", multiple statements to locate the year, month and day and manipulate them, and also find the first ":" and remove it.
I was hoping that there would be an easier way then multiple lines to handle the 24 possibilities (" 00:" through " 23:") of the hour to change them, for example (not synthetically correct, this is just to illustrate the idea):
So on and so on with the other changes also. Does anyone have an idea of a better way?
Any help is appreciated, and I again say thanks in advance... even REGEX would be OK, I just haven't gotten the hand of REGEX.
BEFORE I BEGIN, ALLOW ME TO SAY THANKS FOR ANY HELP THAT CAN BE PROVIDED.
============
Here is what I've been trying to figure out. Lets say in a file I have these lines, amoung others, but these would be on individual lines by themselves:
USER1234 (06/21/2012 02:34:59 PM EST)
XYZ1 (06/21/2012 03:38:14 PM EST)
ABCD (06/22/2012 06:45:05 AM EST)
What I want to do, is for the lines to become:
USER1234 (2012_06_21 1434:59 HOURS ET)
XYZ1 (2012_06_21 1538:14 HOURS ET)
ABCD (2012_06_21 0645:05 HOURS ET)
The hours, minutes and seconds will always be two digits (e.g. "06" instead of "6"). So I want to detect the "AM" or "PM" and convert the hour into the 24-hour clock, while at the same time, removing the ":" between the hour/minute, and change the EST to ET. On that I'd be using this for, it will always display EST or EDT (or maybe EDST).
The usenames can be of any length 1-30 characters, but the time zone will always be EST, EDT or EDST. The only way I can think of is to have two if statements first to find the "AM" or "PM", then within that IF statement eliminate the "AM" or "PM", multiple statements to locate the year, month and day and manipulate them, and also find the first ":" and remove it.
I was hoping that there would be an easier way then multiple lines to handle the 24 possibilities (" 00:" through " 23:") of the hour to change them, for example (not synthetically correct, this is just to illustrate the idea):
Code: Select all
If $line contains " AM" then
if $line contains " 01:" then
locate " 01:" change it to " 01"
remove the "AM"
endif
if $line contains " 02:" then
locate " 02:" change it to " 02"
remove the "AM"
endif
blahblahblah
endif
If $line contains " PM" then
if $line contains " 01:" then
locate " 01:" change it to " 13"
remove the "PM"
endif
if $line contains " 02:" then
locate " 02:" change it to " 14"
remove the "PM"
endif
blahblahblah
endif
Any help is appreciated, and I again say thanks in advance... even REGEX would be OK, I just haven't gotten the hand of REGEX.