Skip to main content
Question

Using root folder as dynamic attribute value


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,

2 replies

takashi
Influencer
  • 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!

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