Page 1 of 1

Replace a forward slash with hyphen

Posted: Tue Jan 22, 2013 2:19 am
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.

Re: Replace a forward slash with hyphen

Posted: Wed Jan 23, 2013 8:42 pm
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-

Re: Replace a forward slash with hyphen

Posted: Thu Jan 24, 2013 2:54 pm
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

Re: Replace a forward slash with hyphen

Posted: Fri Jan 25, 2013 2:30 pm
by DataMystic Support
Hi Tom,

What does the raw value of the footer look like without the properties values substituted?

Re: Replace a forward slash with hyphen

Posted: Sat Jan 26, 2013 3:03 pm
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

Re: Replace a forward slash with hyphen

Posted: Sat Jan 26, 2013 3:30 pm
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 - ?