Skip to main content
Solved

Add data column AND populate by sub directory name

  • April 4, 2013
  • 2 replies
  • 14 views

Hello,

 

 

I have a bunch of mapinfo line.tab files that I want to merge together.  Each .tab file is in a seperate sub directory e.g.

 

 

/test/one/line.tab

 

/test/two/line.tab

 

/test/three/line.tab

 

 

I want to add a 'dir' text column to each layer before merging that is populated with the files sub directory name e.g.

 

 

line.tab layer in the one directory will have a new column added 'dir' and be populated with value 'one'

 

 

line.tab layer in the two directory will have a new column added 'dir' and be populated with value  'two'

 

 

...etc

 

 

I see that hte AttributeCreator transformer can populate data columns, however I'm unsure how to get the data in the format as stated above.

 

 

thank you

Best answer by fmelizard

Hi,

 

expose the fme_dataset and use the FilenamePartExtractor.

 

Hope this helps
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.

2 replies

fmelizard
Safer
Forum|alt.badge.img+21
  • Safer
  • Best Answer
  • April 4, 2013
Hi,

 

expose the fme_dataset and use the FilenamePartExtractor.

 

Hope this helps

david_r
Celebrity
  • April 4, 2013
Hi,

 

 

look at the FilenamePartExtractor, it should help you along.

 

 

David