Hi,
I am currently testing your software for an internet business project. I need to basically use regular expressions to search for a specific format of text and replace this with another format.
The format is this:
7/9/2007 6:00:01 PM.121
The problem is the milliseconds are being appended after the PM. I need to perform an advanced search and replace such that the format for the above example would be:
7/9/2007 6:00:01.121 PM
My expression : [0-9][\:][0-9][0-9][\:][0-9][0-9][\s][A,P][M][\.][0-9][0-9][0-9]
This will find the timestamps in the logs im working with, however can i use another expression to rearrange these. I tried replace with :
[0-9][\:][0-9][0-9][\:][0-9][0-9][\.][0-9][0-9][0-9][\s][A,P][M]
However this did not work and after looking at the forums here it seems you can use $1 in the replace as some kind of placeholder.
Please advise
Kind Regards,
AJ
Regular Expressions Timestamp and Replace
Regular Expressions Timestamp and Replace
aayjay666.bebo.com
Code: Select all
Search for: (.*)\:(.*)\:(.*)\s(.*)\.(\d{3})
Replace with: $1:$2:$3.$5 $4
Perhaps working with smaller chunks at a time?
AJ
aayjay666.bebo.com
Regular expressions are quite slow in comparison to lateral (string) replace operations. But keep AFR running. It will process your file.
BTW. Switch off Preview Mode:
See menu Action - Options - Preview - Use Preview option.
Collecting information for preview is also very time and memory consuming process. It may speed up the process in several times.
BTW. Switch off Preview Mode:
See menu Action - Options - Preview - Use Preview option.
Collecting information for preview is also very time and memory consuming process. It may speed up the process in several times.
Re: Regular Expressions Timestamp and Replace
Hey Roman,
Thanks for the speed up tips. I managed to get the first file done in 6 hours, then the next 2 files took appx 1 hour 30 each, even though they were the same size Using the batch replace and regular expressions i was able to rearrange over 100,000 timestamps ... something im very glad i didn't have to do manually
Thanks for your excellent support and i will be recommending buying this software for anyone who needs this type of application. Just have to get damn approval from the higher uppers
Cheers!
AJ
Thanks for the speed up tips. I managed to get the first file done in 6 hours, then the next 2 files took appx 1 hour 30 each, even though they were the same size Using the batch replace and regular expressions i was able to rearrange over 100,000 timestamps ... something im very glad i didn't have to do manually
Thanks for your excellent support and i will be recommending buying this software for anyone who needs this type of application. Just have to get damn approval from the higher uppers
Cheers!
AJ
aayjay666.bebo.com