Skip to main content
Solved

In the writer properties, how can I change the type/width of many attributes all at once?


makt
Contributor
Forum|alt.badge.img+1
  • Contributor
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

 

.

Best answer by owen

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.
View original
Did this help you find an answer to your question?
<strong>This post is closed to further activity.</strong><br /> It may be a question with a best answer, an implemented idea, or just a post needing no comment.<br /> If you have a follow-up or related question, please <a href="https://community.safe.com/topic/new">post a new question or idea</a>.<br /> If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

owen
Forum|alt.badge.img+1
  • May 29, 2014
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.

makt
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • May 29, 2014
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? 

owen
Forum|alt.badge.img+1
  • Best Answer
  • May 29, 2014
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.

Forum|alt.badge.img
  • October 15, 2015
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!

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