List from csv table and "null"

I retrieve from a recordset a list:
field1,field2,field3,field4,field5,field6 data1,data2,data3,data4,data5,data6

data3 and data4 are null, in example.

When I use list from csv table to convert previous list into two sublist, it happen that data3 and data4 are not in the list, so new sublist are:

((field1 field2 field3 field4 field5 field6) (data1 data2 data5 data6))

How resolve this?


make sure your csv table is always correct, i.e. in each row there must be 5 commas

Correct in the format field1,field2,...data1,data2,,,data5,data6.

When I convert wirh list from csv table null vvalue are not in list.
First row is the output of your table5 code.

are you saying you do not have always 5 commas in each row? this however is precondition for the list from csv table block to work correctly for all rows


here two images, before and after list from csv with real recordset:

On first image, you can see 11 column names (with 10 commas) and 9 values (with 10 commas), null fields are PezziInterni and ContenutiInterni.

On second image, after conversion in list from csv table, first list have all fields name but second list are 9 values (two null values would be between "GR" and "1", but there are not).

run some tests on your csv table lists


Check the length of both lists with the "length list" block.

thanks to your suggestions I started to do several tests.
The real situation was that the null values ​​were at the end of the string, so I found that all of those at the end are truncated.
By swapping the fields in the query and putting as the last field one that surely is present, all commas regularly come out.

I would like to hear from you, however, why it happens.

empty values at the end of lists are retained by AI2....


There is a switch in Screen1 attributes that controls the format of sloppy default list to text conversions. Set it to ask for JSON format conversions, and you will get a rigorous representation of the list.

1 Like