Skip to main content
Solved

Add data column AND populate by sub directory name


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
View original
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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
Contributor
Forum|alt.badge.img+17
  • Contributor
  • Best Answer
  • April 4, 2013
Hi,

 

expose the fme_dataset and use the FilenamePartExtractor.

 

Hope this helps

david_r
Evangelist
  • April 4, 2013
Hi,

 

 

look at the FilenamePartExtractor, it should help you along.

 

 

David

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings