Skip to main content
Solved

Adding date onto feature class name

  • April 15, 2019
  • 4 replies
  • 133 views

Forum|alt.badge.img

Hello,

I'm looking to read a feature class from a GDB (for testing purposes, but eventually this will be many feature classes so this process requires minimal manual handling) and add the date on the end YYMMDD and write back into the same GDB.

E.G

READ - "TEST"

WRITE - "TEST190415"

I've look at ways of doing this and not many seem to work. The closest I've got is to set the reader to expose the 'fme_basename' -> Date/Time Stamper -> Date/TimeConverter (adding _date column to attributes) -> Attribute Manager where I add a new attribute called "New_name", the value is @Value(fme_basename)@Value(_date)

The write is set to Dynamic Schema Definition with the source as the GDB used and the Schema Definition Name set to "New_name".

The output is the GDB name.

When I edited this to just the _date, the output was the date.

So the basename is being read as the gdb, and the date is being picked up in the new attribute.

Can someone please help? I imagine there must be a simpler way to simply add a date onto a feature class name.

Workbench below:

Best answer by nielsgerrits

The way I get this to work is to read both data and schema features, rename fme_feature_type / fme_feature_type_name and write dynamic. I remember seeing somewhere @takashi managed this in a different way but can't recall how exactly and this works for me.

Not sure what causes the new featureclass name to start with an underscore.

I'm used to work with FeatureReaders / FeatureWriters, but this can be done with classic Readers / Writers as well.

2019.0 template workspace added for testing / reproducing.

gdbreadwrite.fmwt

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.

4 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2940 replies
  • Best Answer
  • April 16, 2019

The way I get this to work is to read both data and schema features, rename fme_feature_type / fme_feature_type_name and write dynamic. I remember seeing somewhere @takashi managed this in a different way but can't recall how exactly and this works for me.

Not sure what causes the new featureclass name to start with an underscore.

I'm used to work with FeatureReaders / FeatureWriters, but this can be done with classic Readers / Writers as well.

2019.0 template workspace added for testing / reproducing.

gdbreadwrite.fmwt


takashi
Celebrity
  • 7843 replies
  • April 16, 2019

The way I get this to work is to read both data and schema features, rename fme_feature_type / fme_feature_type_name and write dynamic. I remember seeing somewhere @takashi managed this in a different way but can't recall how exactly and this works for me.

Not sure what causes the new featureclass name to start with an underscore.

I'm used to work with FeatureReaders / FeatureWriters, but this can be done with classic Readers / Writers as well.

2019.0 template workspace added for testing / reproducing.

gdbreadwrite.fmwt

If you set Schema Definition Name explicitly, you don't need to modify the values of "fme_feature_type_name" in the schema feature and "fme_feature_type" in the data features.


nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2940 replies
  • April 16, 2019

If you set Schema Definition Name explicitly, you don't need to modify the values of "fme_feature_type_name" in the schema feature and "fme_feature_type" in the data features.

Thanks, this is really easier.


Forum|alt.badge.img

The way I get this to work is to read both data and schema features, rename fme_feature_type / fme_feature_type_name and write dynamic. I remember seeing somewhere @takashi managed this in a different way but can't recall how exactly and this works for me.

Not sure what causes the new featureclass name to start with an underscore.

I'm used to work with FeatureReaders / FeatureWriters, but this can be done with classic Readers / Writers as well.

2019.0 template workspace added for testing / reproducing.

gdbreadwrite.fmwt

This works perfectly. Thank you so much! (I just tweaked it to add the date on the end and not before the feature name.