Skip to main content
Question

Read file with empty column name

  • May 23, 2022
  • 9 replies
  • 79 views

geo-x
Supporter
Forum|alt.badge.img+6

Dear community,

 

I need to read a txt file who have empty column names like that :

Sans titreHow can I manage my reader for having all columns ?

Thanks for your help.

9 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • May 23, 2022

You can use a CSV reader and set the Field Names Line to 0, the Data Start Line to 1. Then all columns are named col0, col1, col2, etc. Then you can remove the header with a Tester (col1 = number) and use an AttributeRenamer to rename col0 to number etc.


geo-x
Supporter
Forum|alt.badge.img+6
  • Author
  • Supporter
  • 89 replies
  • May 23, 2022

Hi @nielsgerrits​ 

If I do that, I've any data and I can't load my dataset.


nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • May 23, 2022

Hi @nielsgerrits​ 

If I do that, I've any data and I can't load my dataset.

Can you share a sample of your input? When I recreate a CSV of your screenshot I can configure the reader this way, so I wonder how your sample looks like.


geo-x
Supporter
Forum|alt.badge.img+6
  • Author
  • Supporter
  • 89 replies
  • May 23, 2022

Can you share a sample of your input? When I recreate a CSV of your screenshot I can configure the reader this way, so I wonder how your sample looks like.

Yes of course


nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • May 23, 2022

Can you share a sample of your input? When I recreate a CSV of your screenshot I can configure the reader this way, so I wonder how your sample looks like.

This is how it works for me.

Creator --> FeatureReader.

FeatureReader CSV Parameters:

CSV Parameters2021 workspace attached


geo-x
Supporter
Forum|alt.badge.img+6
  • Author
  • Supporter
  • 89 replies
  • May 23, 2022

Can you share a sample of your input? When I recreate a CSV of your screenshot I can configure the reader this way, so I wonder how your sample looks like.

I'm jealous 😂

For me it doesn't works image


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3422 replies
  • May 24, 2022

Can you share a sample of your input? When I recreate a CSV of your screenshot I can configure the reader this way, so I wonder how your sample looks like.

Can you check what is set in the Advance settings?


nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • May 24, 2022

Can you share a sample of your input? When I recreate a CSV of your screenshot I can configure the reader this way, so I wonder how your sample looks like.

Are you using a dynamic input instead of a hard coded? Then you wont see values in the preview but the functionality works.

 

Also, when using a dynamic process, the attributes col1, col2, col3 will be unexposed so you need to expose them manually using the AttributeExposer.


geo-x
Supporter
Forum|alt.badge.img+6
  • Author
  • Supporter
  • 89 replies
  • May 24, 2022

Can you share a sample of your input? When I recreate a CSV of your screenshot I can configure the reader this way, so I wonder how your sample looks like.

Yes, this is my settings :

image