Skip to main content
Question

Removing a hypen-New user baffled

  • June 21, 2013
  • 4 replies
  • 58 views

What transformer shoull I use to remove a hypen forma a file name

 

5555-a becomes 5555a.

 

Thanks
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.

4 replies

takashi
Celebrity
  • June 21, 2013
Hi,

 

 

I would use the StringReplacer:

 

Text to Find: -

 

Replacement Text: <not set>

 

 

Takashi

Hi TakashiTried that (pretty certain I am doing something wrong)

 

Say for eg I have an input MapInfo table called 5555-a and I want the output to be 5555a.... I added the string replacer and nothing happened. I exposed the fme_basename and this was the attribute I defined  along with teh above you sent ?

takashi
Celebrity
  • June 21, 2013
Hi,

 

 

Are you using the dynamic schema functionality so that the destination (output file) schema is same as the source (input file)?

 

If so, you have to change the feature type name of destination schema. To do that, you need to make a schema definition table and make the writer refer to the table. It's not so simple, see Dynamic Schema Examples. Alternatively, if the number of attributes is not many, changing the destination schema to static schema (uncheck dynamic parametiess and set the writer properties manually) might be quicker solution.   Takashi

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • June 24, 2013
Hi,

 

I tried it out on a txt-file.

 

 

Do the StringReplacer on the exposed fme_basename (wich holds the txtfilename).

 

To get it to write it i then set the writer Attribute to Fanout on to basename. And fanoutdirectory of choice. Apparently i cannot do this on the wirter transformer, but must do it in te Navigator-pane Parameters>Advanced.

 

As u can see in insert it writes bla-bla-6.txt to blabla6.txt