Skip to main content
Question

Using root folder as dynamic attribute value

  • May 29, 2014
  • 2 replies
  • 20 views

Forum|alt.badge.img
Hi there,

 

 

I'd like to use the folder name of the location of my shapefiles as a attribute value.

 

I've exposed fme_dataset t provide me with:

 

C:\\Deployment\\FME Workspaces\\Stats\\April\\Network.shp

 

 

It's just a simple xls writer, with a "Source" attribute I created. All I want populated in the "Source" attribute is "April" or whatever else the base folder where the shapefiles are located is named.

 

 

 

Thanks in advance,
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

takashi
Celebrity
  • May 29, 2014
Hi,

 

 

a format attribute named "fme_dataset" contains the full path of the source file. Expose it in the reader feature type. You can then use the FilenamePartExtractor transformer to extract the folder name as an attribute.

 

 

Hope this helps,

 

Takashi

Forum|alt.badge.img
Works Fantasticall.

 

 

Don't know how I missed this one, but thank you!