Comments and answers for "how to expose attribute names?" https://knowledge.亚搏在线safe.com/questions/23890/how-to-expose-attribute-names.html The latest comments and answers for the question "how to expose attribute names?" Answer by gio https://knowledge.safe.com/answers/24069/view.html

@robertdbuckley

Here is a way to do it (drag drop file didnt work for me, so here are pics)

Greets.

Wed, 02 Mar 2016 17:24:24 GMT gio
Answer by mark2atsafe https://knowledge.safe.com/answers/24017/view.html

Basically you need to sort the features, for which a numeric value works best.So assuming you know the attribute names in advance, put an AttributeCreator/Manager down.Create SortKey and use conditional mode.If attribute exists abcd then SortKey=1, else if attribute exists abcde then SortKey=2

Then sort data by SortKey.

Does that help?

Tue, 01 Mar 2016 16:19:01 GMT mark2atsafe
Answer by gio https://knowledge.safe.com/answers/23966/view.html

Use schema reader and path reader to create a list of attributes to create a file_attributename table.

U can use a merger on filename to link schema and path.

I found workspaces posted here 2014 about exactly the same question.

I vote for stack-exchange like point rewardsystem ...;)

Mon, 29 Feb 2016 17:23:13 GMT gio
Answer by daleatsafe https://knowledge.safe.com/answers/23911/view.html

This is an interesting one for sure.I think we need to understand a bit more of the problem before we can provide some additional guidance.

In particular, do you know at the time you make the workspace what the field names are for all the CSV files you're working with.Or do you need to make a workspace that will work with any set of CSVs someone may throw at you, whose column names you don't know.

If it is the former situation and you know the field names (schemas) ahead of time, then I can imagine one workflow to explore.

If you don't know the field names, then another (more complex) workflow would be needed.

Lastly, AttributeExploder potentially could be your friend here...but I won't make that promise.

Maybe provide us with a set of input files (faked if necessary) and desired output and we can puzzle from that...

Sat, 27 Feb 2016 18:14:14 GMT daleatsafe
Answer by erik_jan https://knowledge.safe.com/answers/23897/view.html

To expose names of attributes that are attached to the features the AttributeExposer transformer can be used.The CSV reader has an option to skip the first line and use the contents as field names.I assume you used that option on the reader.

Fri, 26 Feb 2016 17:04:12 GMT erik_jan
Answer by jdh https://knowledge.safe.com/answers/23892/view.html

You can get the attribute name from a schema reader, the schema port of the FeatureReader transformer, or in python using the getAllAttributeNames method.

Fri, 26 Feb 2016 15:51:44 GMT jdh