CSV Export from file with NULL values (columns shifted)

ataylor14 21 May, 2018
This is a strange behaviour.

When values are missing in the table for certain columns there field itself is not appearing in the csv downloaded file so columns are shifted to the left. This creates a messy file. If I download the csv straight from the table in the db (i.e., not using chronoconnectivity) all is fine.

So for example if in teh table I have
Name Total, F1, F2
A 100 f11 f12
B 110 f22
C 120 f31 f32

In the csv file I will have
Name Total, F1, F2
A,100,f11,f12
B,110,f22
C,120,f31,f32

etc.

Has anyone seen this behaviors? What can be the couses/ fixes?

Many thanks
GreyHead 22 May, 2018
Hi ataylor14 ,

I assume that this is CFv6. It may be that no delimiter is set - that would show "", for an empty entry. What do you see in the CSV file itself, is the data there correct?

Bob
ataylor14 22 May, 2018
Hi Bob,
When you say 'no delimiter is set' do you mean in the csv download function?
There is a delimiter set and the csv download works and separates the values with the specified delimiter.

The problem is for columns with missing values for some records, those columns as I said, for some records get shifted to the left. So if there is no value it looks as if the column in not included for those rows only.

So for records that have all values for all fields all is well. But for records in teh table that might have gaps...thos columns with no values are skipped on the row.
Not sure if that explains the behaviour.

But there is nothing wrong with the table as I can download / export the data into a csv file without any issues using straight from the db (e.g., phpmyadmin).

But when downloading from chronoconnectovity I see this behaviour

Thank you for your help
GreyHead 22 May, 2018
Hi ataylor,

Sorry, when I wrote 'delimiter' I meant to say 'enclosure' - that is typically a double quote that is used around text strings. You can't set that but I assume that it is added by CFv6.

What do you see in the CSV file itself, is the data there correct?

Bob
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger