Skip to main content
Question

obtain the sourcedata file name dynamically when using a folder as a source

  • September 3, 2016
  • 3 replies
  • 81 views

Hi

I am trying to set up a dynamic workbench to convert a dwg drawing with object data to an ADAC xml file. I am pointing to a folder as the dwg source file. The source folder will contain a dwg file which will be deleted upon conversion. so the next incoming dwg will have a different name. I want the destination xml file to have the same name as the incoming dwg file. Could some one please confirm if this is possible and if so suggest methhods that I could use to achieve this objective.

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.

3 replies

itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • September 3, 2016

Hi @luckydesilva,

You can use the following:

Read the folder content with a merge feature type (*.dwg) and expose the fme_basename for the DWG file name.

Another option is to use the directory and file paths reader with a filter (*.dwg) and use the attributes produced by the reader for location and file name.

A shutdown Python script or a simple systecaller dos combination can help delete the original file.

Hope this helps.


  • Author
  • September 3, 2016

Hi Itay

I shall try the merge feature option. I think I tried the "filename path extractor" but this does not appear to work. I maybe doing something wrong of course.

Thank you!


itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • September 3, 2016

Hi Itay

I shall try the merge feature option. I think I tried the "filename path extractor" but this does not appear to work. I maybe doing something wrong of course.

Thank you!

you need to specify in the reader settings to retrieve file properties