Replace a forward slash with hyphen

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 a forward slash with hyphen

Post by TomQA »

Hello,
I need to replace a forward slash with a hyphen. An example of the string format is -F102/5.2 and I want to replace the slash with the hypen to produce -F102-5.2. I tried search for \-F*\/ and replace with \-F*\- but that did not work.
Thank you in advance.
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Replace a forward slash with hyphen

Post by DataMystic Support »

Ensure wildcard matching is on, then search for:

Code: Select all

-F([0-9]{1,})/
Replace with

Code: Select all

-F\1-
TomQA
Posts: 10
Joined: Tue Jan 22, 2013 1:54 am

Re: Replace a forward slash with hyphen

Post by TomQA »

Hi Simon,

First, thanks for getting back to me. I did not try Wildcards. I didn't tell you that this part of the string "FSSQA-F102" is in the Built-in Property, "Document number" and the slash "/" is not in any Property and the "5.2" is in Custom Property, "DocRevision". So the result should be "-F102-5.2". 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 a forward slash with hyphen

Post by DataMystic Support »

Hi Tom,

What does the raw value of the footer look like without the properties values substituted?
TomQA
Posts: 10
Joined: Tue Jan 22, 2013 1:54 am

Re: Replace a forward slash with hyphen

Post by TomQA »

Hi Simon,

I don't know what you mean by "raw value". If you show the fields using Alt+F9, it looks like this:
{ DOCPROPERTY "Document number" \*MERGEFORMAT } / { DOCPROPERTY DocRevision \*MERGEFORMAT }

Is there a way for me to send you my docx?

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

Re: Replace a forward slash with hyphen

Post by DataMystic Support »

Sorry To, for some reason I thought you were doing this with ExcelPipe on Excel footers.

Can you set the location just to Footer, and specify replace / with - ?
Post Reply