• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » CSV headers with hyphons and quotes.

#1 2012-06-26 19:11:30

macintro
Member
Registered: 2010-05-05
Posts: 42

CSV headers with hyphons and quotes.

Tags: [CSV file, schema]

Is there a way to create a column name in a CSV file as follows: "SKU-2012-MKS","First-Name"

Every time I generate a schema from a CSV template with column names as the above it changes the column names to _SKU_2012_MKS_,First_Name

Thanks

Offline

#2 2012-06-27 04:58:00

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: CSV headers with hyphons and quotes.

Hi

Please follow these steps:
1.Go to Window-->Preferences-->Talend-->Specific Settings and check the box 'Allow specific characters(UTF8...) for columns of schema.'
2.Click the 'OK' button to save the change and close the window.

Regards,
Pedro


Only Paranoid Survive.

Offline

#3 2012-06-27 17:49:48

macintro
Member
Registered: 2010-05-05
Posts: 42

Re: CSV headers with hyphons and quotes.

Thanks Pedro!!  This doesn't quite solve it though. After switching to use the UTF8 as you described now I get a compilation error for those column names. It looks like the hyphon is making the system think that it is a separate variable.

What I mean by that is... If I have a column name such as SKU-2012-MKS when I compile it I get an error saying "SKU cannot be resolved to a variable" as well as "2012 cannot be resolved to a variable" and "MKS cannot be resolved to a variable"

Any thoughts on this? I tried escaping the column name as "\"SKU-2012-MKS\"" and no dice either.

Thanks again for the help.

Offline

#4 2012-06-28 03:29:10

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: CSV headers with hyphons and quotes.

Hi

I click on the code tag and notice that Talend job will declare a String variable like this:
Public String SKU-2012-MKS
It is against the basic rule of Java and cause errors.
Sorry. You cannot use "-" in the column name.

Regards,
Pedro


Only Paranoid Survive.

Offline

#5 2012-06-28 17:09:09

macintro
Member
Registered: 2010-05-05
Posts: 42

Re: CSV headers with hyphons and quotes.

Yep. I arrived at that conclusion yesterday. Thanks for the confirmation.

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » CSV headers with hyphons and quotes.

Board footer

Powered by FluxBB