I know you all can help but I always try and figure it out on my own.
I have a line in a file that starts with the Day of the week (3 characters), The date, in this format MM/DD/YYYY and then the time of day. Just FYI, its a log file and the rest of the line returns a comma, the computer name, another comma and then the log entries. The very first line returns the script name that created the log and the version. Like this…
Tue 09/03/2024 8:43:21.88, My Little Script, Script Rev. 3
I am trying to get the date, using relevance, to format in this way…
YYYYMMDD
Getting the time would be helpful too, in this format…
HHMM (no need for seconds)
To end up with something like this.
YYYYMMDDHHMM
I can get the line, and get the year and everything after it, but not sure how to get the rest of what I need.
q: line 1 of it of file "C:\scripts\MyLittleScriptLog.log"
A: Tue 09/03/2024 8:43:21.88, Computer-SF, My Little Script Rev. 3
T: 2.464 ms
q: following texts of last "/" of (line 1 of it of file "C:\scripts\MyLittleScriptLog.log")
A: 2024 8:43:21.88, Computer-SF, My Little Script Rev. 3
T: 1.760 ms
The first thing I do not like about this is it assumes that the “/” is the last one in the line. In this log, and other logs I will use it on, it will always be the last “/” but I don’t want to assume.
I don’t know how to get X num of charters after a string I find.
I always welcome your suggestions.