Skip to main content
Question

Writing CSV file with leading and trailing spaces in the field names

  • September 16, 2020
  • 4 replies
  • 111 views

pmcpherson
Contributor
Forum|alt.badge.img+9

I'm trying to write a CSV file with leading and trailing spaces in the field/column names. I know this is unusual, but is required for a specific deliverable. The feature writer transformer does not appear to allow this. Any ideas on how best to accomplish this?

4 replies

david_r
Evangelist
  • September 16, 2020

I was able to make it work by importing the feature type definition from an existing CSV with spaces in the column names.


pmcpherson
Contributor
Forum|alt.badge.img+9
  • Author
  • Contributor
  • September 16, 2020

Thanks for the quick response. I'm not really sure how to implement that solution, but I'll try it.


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • September 16, 2020

You could also just choose not to write the field names in the writer, and send a record which contains the field names including spaces as the first record to write.


pmcpherson
Contributor
Forum|alt.badge.img+9
  • Author
  • Contributor
  • September 16, 2020

Thanks to all for your help. Turns out I was making a simple mistake, which resulted in a problem that should not have been a problem. It is simple to add the white space in the writer itself by using the "Manual" radio button under the "User Attributes" tab. When I did that, I inadvertently forgot to update the "Value" field on the right-hand side to the pane to correspond with the correct source field, which at this point does not automatically match due to adding the white space manually.


Reply


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