"CSV/TXT: Read" Does not capture last column(s) if they are blank, EVEN IF they have headers

  • 17 January 2024
  • 2 replies
  • 67 views

Userlevel 3
Badge +9

Has anyone else noticed that the "CSV/TXT: Read" action ignores the last column in a CSV if that column is null, despite the column having a header?

 

For example, if you open the following CSV and read it:

key val1 val2 val3 val4
1001   “StringData” “StringData”  
1002 “StringData”

 

“StringData”

 

 

Your data table will only have 4 columns, “key”, “val1”, “val2”, and “val3”; “val4” will be omitted.

 

This seems like an oversight to me and I think it should be fixed in future releases. I think we should at least have the option to toggle “headers” on and off to tell the “read” action how to interpret our files.

 

EDIT:

The “read” action appears to read the final column, but you can’t reference it. For example, I have a CSV with 14 columns, and the last is blank. When read into a DataTable, the table column count is 14, but when I reference index “13” (which is the 14th index position), I get an error that the index is out of bounds. Very odd to me.


2 replies

Userlevel 2
Badge +8

Yeah, there is some odd behavior in the data table package. I’m curious if your csv has a blank column by default for all records or if you’re expecting values there sometime in the future?

If it’s a blank column for updating while you’re processing (like with a status or something) don’t include it on the import csv. Instead, add the blank column in AA after you bring it in.

Userlevel 3
Badge +9

Yeah, there is some odd behavior in the data table package. I’m curious if your csv has a blank column by default for all records or if you’re expecting values there sometime in the future?

If it’s a blank column for updating while you’re processing (like with a status or something) don’t include it on the import csv. Instead, add the blank column in AA after you bring it in.

Hey @JMarino - It’s a “comments” field coming from an Excel form. The field is technically required, so I expect there to be data in the future. Unfortunately, I will need to keep it in the CSV to capture any comments that come through the form. 

Reply