Solved

How to save the Attribute definition in a csv ?

  • 9 February 2022
  • 4 replies
  • 1 view

Hi ! I wanted to know if there was a way to save the attributes definition (Name, type and width) in to a CSV.

Thanks for the help !

icon

Best answer by markatsafe 9 February 2022, 22:07

View original

4 replies

Badge +2

Hi @fmenewbie_jr​ ,

 

Check out the new SchemaScanner transformer - it'll tell you everything you need. Here is an example with an Excel file where it provides the name, data type (<width>, <precision if applicable>). A schema feature will store all of this in a list which you can explode with a ListExploder. Then you can parse/format as needed for your desired output.

imageIf you are using an older release of FME, you can still get this information with a schema feature using either the Schema Reader or a schema feature from the FeatureReader.

Hi @fmenewbie_jr​ ,

 

Check out the new SchemaScanner transformer - it'll tell you everything you need. Here is an example with an Excel file where it provides the name, data type (<width>, <precision if applicable>). A schema feature will store all of this in a list which you can explode with a ListExploder. Then you can parse/format as needed for your desired output.

imageIf you are using an older release of FME, you can still get this information with a schema feature using either the Schema Reader or a schema feature from the FeatureReader.

Thanks for the answer ! that's a very straight forward transformer to do what i want, but I only have access to the 2020 version of FME and I can't find the transformer so I guess it's only for the newer versions of the software ?

Badge +2

Thanks for the answer ! that's a very straight forward transformer to do what i want, but I only have access to the 2020 version of FME and I can't find the transformer so I guess it's only for the newer versions of the software ?

You can use the Schema (any format) instead, or the FeatureReader <schema> port

Thanks for the answer ! that's a very straight forward transformer to do what i want, but I only have access to the 2020 version of FME and I can't find the transformer so I guess it's only for the newer versions of the software ?

I combined the two answers and used the FeatureReader with a ListExploder and it worked ! thanks for the help !!

Reply