Question

My readers are csv files with uniform # of commas in each row, but with no headings. And each file name is unique and needs to be made an attribute. Is there a way to add attribute names as I read in each file?

  • 30 March 2017
  • 1 reply
  • 0 views

Badge


1 reply

Userlevel 2
Badge +17

Hi @angela, you can configure the CSV reader to generate the default attribute names (col0, col1, ... colN) through the parameters dialog when you add the reader to a workspace.

In FME 2017, clear (set empty to) the Field Names Line.

In FME 2016, uncheck the File Has Field Names checkbox.

Then rename the default attribute names to your desired names in the workflow.

The source CSV filename will be stored in a format attribute called "fme_basename". You can expose it in the reader feature type dialog.

Reply