Column mismatch
- FlowHeater-Team
- Topic Author
- Offline
- Admin
Less
More
14 years 4 months ago - 1 year 3 weeks ago #2009
by FlowHeater-Team
Best wishes
Robert Stark
Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.
Column mismatch was created by FlowHeater-Team
Translated submission in the German forum. You can read the original entry
here
.
Sometimes CSV or TXT files lack a few column separators (the table contents are thereby shifted one column to the left). Is there an option of some sort where you can define the column count and whenever it is less, skip the whole row?
ali
Sometimes CSV or TXT files lack a few column separators (the table contents are thereby shifted one column to the left). Is there an option of some sort where you can define the column count and whenever it is less, skip the whole row?
ali
Best wishes
Robert Stark
Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.
Last edit: 1 year 3 weeks ago by FlowHeater-Team.
Please Log in or Create an account to join the conversation.
- FlowHeater-Team
- Topic Author
- Offline
- Admin
14 years 4 months ago #2010
by FlowHeater-Team
Best wishes
Robert Stark
Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.
Replied by FlowHeater-Team on topic Re:Column mismatch
Hi Ali,
You can achieve this using the If-Then-Else Heater together with the Filter Heater.
1. Drag both heaters onto the Designer window
2. Connect the last CSV text file field as input to the If-Then-Else Heater
3. Connect the output of the If-Then-Else Heater to the Filter Heater
4. Double click on the If-Then-Else Heater
5. Set the condition to "= NULL"
This procedure will filter out any row where there is an insufficient number of separators.
How does that work? When the TextFile Adapter reads a CSV file in, fields are undefined if they are unavailable. This unavailability is detected by the conditional test described above. If one or more field separators are missing in the row, the last field is always set to NULL.
You can achieve this using the If-Then-Else Heater together with the Filter Heater.
1. Drag both heaters onto the Designer window
2. Connect the last CSV text file field as input to the If-Then-Else Heater
3. Connect the output of the If-Then-Else Heater to the Filter Heater
4. Double click on the If-Then-Else Heater
5. Set the condition to "= NULL"
This procedure will filter out any row where there is an insufficient number of separators.
How does that work? When the TextFile Adapter reads a CSV file in, fields are undefined if they are unavailable. This unavailability is detected by the conditional test described above. If one or more field separators are missing in the row, the last field is always set to NULL.
Best wishes
Robert Stark
Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.
Please Log in or Create an account to join the conversation.
Time to create page: 0.252 seconds