Buy Now
Sign in

CSV Export from file with NULL values (columns shifted)

ataylor14 , May 21 at 15:21
A
ataylor14
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
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
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
A
ataylor14
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
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
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much