Skip to main content
I am looking for a shortcut (transformer?) that will change attributes' type and width all at once. Holding down shift  can select all the rows of attributes, but then the change made is not applied to all the rows selected. 

 

 

For exmaple, in the below picture, I want to change all "char" to "number", and the width from 200 to 20

 

.
Hi there. I dont think there is an easy way to change all field types and widths.

 

 

If you are replicating another dataset on your writer, you can use a dynamic writer which will automatically retain the field structure of the input data on your writer. Or, you can right click your reader and choose 'duplicate on writer', and/or 'copy attributes from reader/transformer' on the writer.
Hi Owen,

 

The way I obtained the screenshot above was by right clicking "copy attributes from transformer" - I don't know why it automatically assumed all my numbers where char type, which is why I thought I was missing something. Could I not somehow explicitly state that types of the attributes before I do the copy? 
As different formats can accept different field types, FME doesnt confine data to being a specific field type as it flows through a workspace. So when it comes to copying attributes from a transformer it doesnt really know what they are - it is only by getting the schema definition from a reader that FME maps these to an equavalent field on your writer format.

 

 

If a dynamic writer doesnt quite fit what you want to write out, you can also add your own fields that you create in the workspace, or remove fields.
This seems an obvious ommission by Safe - the ability to select and change multiple attributes is long overdue. I have a shape file with 200 fields, all of which need changing as above - I have to manually change the type, width and precision on each. This means 600 manual changes are needed!

Reply