Hello:
I am working on a script that takes a .txt log file and puts it in a
database. I have everything working on this script with the exception of one
small item: Date Conversion (which I am manually doing at this time).
I need to replace the format of the date (YYYY-MM-DD) in the text file to be
the same format as the filename.
Filename:
11-27-2005-PingLogs.txt
Sample text:
2005-11-27 00:00:47,192.168.2.1,Ping: No Response
2005-11-27 00:00:47,192.168.2.1,Ping: No Response
2005-11-27 00:00:47,192.168.2.1,Ping: No Response
2005-11-27 00:00:47,192.168.2.1,Ping: No Response
2005-11-27 00:00:47,192.168.2.1,Ping: No Response
Converted date:
11-27-2005,00:00:47,192.168.2.1,Ping: No Response
11-27-2005,00:00:47,192.168.2.1,Ping: No Response
11-27-2005,00:00:47,192.168.2.1,Ping: No Response
11-27-2005,00:00:47,192.168.2.1,Ping: No Response
11-27-2005,00:00:47,192.168.2.1,Ping: No Response
How can I find each occurrence of the YYYY-MM-DD format and replace it with
the same format in the filename?
P.S. I cannot get the date to export any other way to the log file.
Thanks
CADstillo