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.

  • 23 November 2022
  • 5 replies
  • 7 views

Badge +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

icon

Best answer by danminneyatsaf 29 November 2022, 01:13

View original

5 replies

Userlevel 2
Badge +10

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

Badge +1

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@

Badge +1

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"?

Userlevel 2
Badge +10

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

Badge +1

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!

Reply