Hi,
I'm rather new to TextPad and have read through some postings and help, but can't seem to come across a solution to the following:
I'd like to open an exiting file, find a known date (yyyymmdd), replace that date with the current date, then save the file as filenameyyyymmdd.txt where yyyymmdd is the current date.
I was able to record a macro that opened the file, found the date, but can't seem to figure out how to get the current date into the Search | Replace window.
I'll execute this from vbs file, and do know that I can set NewDate = but can I paste NewDate in the Replace window or something like that?
Sorry if this seems rather lame and ignorant - but any suggestions would be appreciated very much.
MoGoo
Replacing date string with current date and saving
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
You wrote:
========================
1. Change the format of the system date:
If you have a Windows system, open the Control Panel.
Double click on Regional Settings
Goto the tab for date
Go to the section for Short Date
Change setting to yyyyMMdd
Click on Apply
Check the Short Date sample in the field above
Click on OK
Note that this will affect the appearance of Date in most other applications also.
=============================
2. Use Regular Expressions to change format after doing Insert.
The search and replace strings will depend on your existing format but might look something like this:
====
Search for ([0-1][0-9])/([0-3][0-9])/(20[0-9][0-9])
Replace with \3\1\2
====
NOTE:The regex sample above is unchecked, untested, first pass, crude, basic, not modified for TextPad syntax. For example, every parenthesis symbol needs to be prefaced with \.
======================
Hope this helps
Two approaches:if I can get the format to yyyymmdd.
========================
1. Change the format of the system date:
If you have a Windows system, open the Control Panel.
Double click on Regional Settings
Goto the tab for date
Go to the section for Short Date
Change setting to yyyyMMdd
Click on Apply
Check the Short Date sample in the field above
Click on OK
Note that this will affect the appearance of Date in most other applications also.
=============================
2. Use Regular Expressions to change format after doing Insert.
The search and replace strings will depend on your existing format but might look something like this:
====
Search for ([0-1][0-9])/([0-3][0-9])/(20[0-9][0-9])
Replace with \3\1\2
====
NOTE:The regex sample above is unchecked, untested, first pass, crude, basic, not modified for TextPad syntax. For example, every parenthesis symbol needs to be prefaced with \.
======================
Hope this helps
Hope this was helpful.............good luck,
Bob
Bob