Skip to main content
Solved

I'm trying to enter a user parameter to use in a String Replacer Transformer I've tried entering the values in the Details below and am stumped.

  • November 23, 2022
  • 5 replies
  • 94 views

Forum|alt.badge.img+1

 

Value in Source Data:

DWGNAME,OLDHANDLE,NEWHANDLE,X1,Y1,TYPE,NEW_ID

BDCV.dwg,3F7,16354,2181887.040872167,12004078.93869873,ROUTE,1233345

The String replacer is defined like $(DrawPath)@Value(DWGNAME)

Output from transformer:

If DrawPath Parameter=C:\\ClientMaps\\

C:\\ClientMaps DEFAULT_MACRO FME_DATA_REPOSITORYBDCV.dwg

if DrawPath Parameter=C:\\ClientMaps

C:\\ClientMapsBDCV.dwg

 I need the output to be C\\ClientMaps\\BDCV.dwg

Thanks

Best answer by danminneyatsaf

I tried the AttributeCreator and got the same results. If the $(DrawPath) parameter value is C:\\ClientMaps\\, the original DGNAME attribute is BDCV.dwg, the Attribute value in the transformer is $(DrawPath)@Value(DWGNAME) the output is C:\\ClientMaps DEFAULT_MACRO FME_DATA_REPOSITORYBDCV.dwg. Isn't there some way to include the backslash in the User Parameter without is adding the " DEFAULT_MACRO FME_DATA_REPOSITORY"?

To fix this issue, go into your User Parameter Manager and change the Text Configuration of the DrawPath User Parameter from Plain Text (Uniline) to Plain Text (Multiline).

image

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

danminneyatsaf
Safer
Forum|alt.badge.img+13
  • Safer
  • 485 replies
  • November 28, 2022

Hi @dutchtower​ in the StringReplacer, you can define the Replacement Text parameter to $(DrawPath)\\@Value(DWGNAME) so that the missing backslash is output with your data.

 

Alternatively, what you're trying to do here is much better suited for the AttributeCreator transformer. If I'm misunderstanding your goal or your scenario, please let me know!

image.png


Forum|alt.badge.img+1
  • Author
  • 7 replies
  • November 28, 2022

Dan, Thanks for the reply. I tried the backslash in the middle of the string as you suggested before posting the original issue and it does work. I guess I was overthinking it. You know...just in case the File path wasn't Windows-based. I'll nose around a little with the AttributeCreator Transformer too.

Thanks again@


Forum|alt.badge.img+1
  • Author
  • 7 replies
  • November 28, 2022

I tried the AttributeCreator and got the same results. If the $(DrawPath) parameter value is C:\\ClientMaps\\, the original DGNAME attribute is BDCV.dwg, the Attribute value in the transformer is $(DrawPath)@Value(DWGNAME) the output is C:\\ClientMaps DEFAULT_MACRO FME_DATA_REPOSITORYBDCV.dwg. Isn't there some way to include the backslash in the User Parameter without is adding the " DEFAULT_MACRO FME_DATA_REPOSITORY"?


danminneyatsaf
Safer
Forum|alt.badge.img+13
  • Safer
  • 485 replies
  • Best Answer
  • November 29, 2022

I tried the AttributeCreator and got the same results. If the $(DrawPath) parameter value is C:\\ClientMaps\\, the original DGNAME attribute is BDCV.dwg, the Attribute value in the transformer is $(DrawPath)@Value(DWGNAME) the output is C:\\ClientMaps DEFAULT_MACRO FME_DATA_REPOSITORYBDCV.dwg. Isn't there some way to include the backslash in the User Parameter without is adding the " DEFAULT_MACRO FME_DATA_REPOSITORY"?

To fix this issue, go into your User Parameter Manager and change the Text Configuration of the DrawPath User Parameter from Plain Text (Uniline) to Plain Text (Multiline).

image


Forum|alt.badge.img+1
  • Author
  • 7 replies
  • November 29, 2022

To fix this issue, go into your User Parameter Manager and change the Text Configuration of the DrawPath User Parameter from Plain Text (Uniline) to Plain Text (Multiline).

image

Thanks...this fixed it!