Replace old date with current date

Discuss WordPipe, ExcelPipe and PowerPointPipe. Get help with installation and running, notify us of bugs, request new features and enhancements.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
TomQA
Posts: 10
Joined: Tue Jan 22, 2013 1:54 am

Replace old date with current date

Post by TomQA »

Hello,
How do I replace a date in a Word custom property with a new date, or better, the current date? Using a date format of mm/dd/yy.
I searched for *\/*\/* and wanted to replace with 01/21/13, but nothing was replaced.

Thank you.
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Replace old date with current date

Post by DataMystic Support »

Did you have wildcards switched on?

Try:

Code: Select all

[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{1,2}
TomQA
Posts: 10
Joined: Tue Jan 22, 2013 1:54 am

Re: Replace old date with current date

Post by TomQA »

Hi Simon,
I did not try Wildcards. The date is in the Custom Property, "EffectiveDate". My goal is to find the current date and replace it with the current date. The entire footer looks like this:

FSSQA-F102/5.2 Corrective Preventive Action Request Page 1 of 1 Approved: TFS Effective: 4/3/2008

Your solution didn't make any changes, but then I didn't give you all of the information.
What can I try next?

Thank you,

Tom
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Replace old date with current date

Post by DataMystic Support »

If the date is in the Custom Property, did you set the search location to 'Custom properties'?

The wildcards I gave you won't work in the footer, instead, use the EasyPattern Search Replace type of:

Code: Select all

[ 1-2 digits ]/[ 1-2 digits ]/[ 4 digits ]
TomQA
Posts: 10
Joined: Tue Jan 22, 2013 1:54 am

Re: Replace old date with current date

Post by TomQA »

Hi Simon,

I had chosen Custom Properties in Search Location and the new code changed the value of the Custom Property, EffectiveDate. However, the date shown in the footer did not change, in other words, the document didn't refresh. I had to press F9 to force the update. Can WordPipe force a field update?

Tom
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Replace old date with current date

Post by DataMystic Support »

Yes! See the Options tab, Update field codes before save.
TomQA
Posts: 10
Joined: Tue Jan 22, 2013 1:54 am

Re: Replace old date with current date

Post by TomQA »

Hi Simon,

I had "Update field codes before save" checked and it did not update. Things just got really serious for me because I thought I had only 135 files to change, but I have 548 files! WordPipe is the only possible solution for me. If its alright with you, I'd like to combine this thread with my other thread on replacing the hyphen.
To reinterate, I'm using Word 2010 and my documents are a variety of .DOC, .DOCX, .DOTX .DOTM. The footer text is giving me all the trouble. The text that needs to be changed in the footers look like this:
FSSQA-F102/5.2 Effective: 4/3/2008
I need to make the footers look like this:
FSQA-F102-5.2 Effective: 2/1/13
The "FSS" becomes "FS" and the text "QA" will change depending on the document, as will the number following the "F" and before the "/". The number is one to three digits. In this example, the text in "FSSQA-F102" is in the "Document number" Built-in property field, the "5.2" is in the "DocRevision" Custom property field. The date is in the "EffectiveDate" Custom property field. The documents are protected, but the "unprotect" feature is working fine. I know this because that changes to the body text are correct.

Again, thank you for your time.

- Tom
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Replace old date with current date

Post by DataMystic Support »

Hi Tom,

The Options tab, Update field codes before save, will only occur if a change has been made to the document. So you might need to replace e.g FS with FS (ie itself) to trigger this change. Checking Options\Force Word to save changes may also help.

Please send us a sample document and your settings, either by zipping and uploading here in the forums, or by sending to our email address.
TomQA
Posts: 10
Joined: Tue Jan 22, 2013 1:54 am

Re: Replace old date with current date

Post by TomQA »

Hi Simon,

There are several changes made to the document in the body, as well as in the footer. Attached are a sample document, not protected and one of my many WordPipe .wpp files.
8-Replace forward slash and Effective Date.zip
WordPipe file
(1.09 KiB) Downloaded 3507 times
FSSQA-F2 Corrective Action.zip
form needing changes
(22.21 KiB) Downloaded 3348 times
Thank you!!

Tom
Post Reply