Skip to main content
Solved

Generic Reader - CSV parameters

  • January 13, 2015
  • 3 replies
  • 34 views

Hello,

 

 

When using the Generic Reader and running a CSV file through it, is it possible to specify the CSV parameters somewhere. In the Log file when I run it as is I see:

 

 

Opening the GENERIC Reader on dataset `C:\\Temp\\Northgate_Edgbaston.csv'

 

CSV Reader: Opening CSV files in directory `C:\\Temp/\\'

 

CSV Reader: Separator Character: ','

 

CSV Reader: Skip Duplicate Delimiters: no

 

CSV Reader: Strip Quotes From Fields: no

 

CSV Reader: File Has Field Names: no

 

CSV Reader: Field Names Follow Header: no

 

CSV Reader: Number of Lines to Skip: 0

 

CSV Reader: Number of Footer Lines to Skip: 0

 

CSV Reader: Encoding name ''

 

CSV Reader: Allowing Spaces in Column Names: no

 

CSV Reader: Max features to scan for schema: 10000

 

CSV Reader: Opening dataset 'C:\\Temp\\Northgate_Edgbaston.csv'

 

 

But I'd like to be able to set these parameters so that I can specify that the CSV file has field names and to strip quotes from fields.

 

 

Thank you,

 

 

Peter.

Best answer by fmelizard

Hi Peter,

 

 

Add a csv reader as a workspace resource, configure the reader's parameters to your liking and voila, the generic reader will use them.

 

This also applies to the generic writer, but with a dedicated writer of the formats used.

 

Hope this helps,

 

Itay
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • January 13, 2015
Hi,

 

 

Appearently on the Generic reader not.

 

But if you use a csv reader for csv, you can do that in the parameter section on the reader.

fmelizard
Safer
Forum|alt.badge.img+21
  • Safer
  • Best Answer
  • January 13, 2015
Hi Peter,

 

 

Add a csv reader as a workspace resource, configure the reader's parameters to your liking and voila, the generic reader will use them.

 

This also applies to the generic writer, but with a dedicated writer of the formats used.

 

Hope this helps,

 

Itay

  • Author
  • January 14, 2015
Thanks for your help, I've added a CSV Reader as Resource and got it to work fine. As it forced you to put a path in for the CSV file I've just put in '.' instead of a dummy file. This seems to be working fine.