export to CSV problem

Hello,

DaDaBik: 4.2
Linux tux5 2.6.11.4-21.17
PHP Version 4.3.11
MySQL: newest

I have a problem with export to CSV.
The export works fine, but when I import the the CSV file to MS EXCEL some (about 50 of 975 entries at the time) are not correct inserted in the table.
I use the "$" Dollar sign as column separator, so most others are used in the text fields in the database.
Maybe I sould try the Tabstop, but how to do this in the "config.php".

Any suggestions?

Thanks

Mario

 

DebbieS

DaDaBIK Guru
The only thing I can think of is to use \t and test that. When you leave the separator as a comma, does that data not convert properly? I've always left mine as the comma and have never had a problem with exporting any data regardless of the contents.

 
I have trie now - I think so - all possibilities, and it dont work proper. So I have the "$" as CSV separator again.

Here two examples of the exported CSV and what might be the problem.
This is inserted correctly:
Aellen, V.$"1958"$"Sur une nouvelle forme d´Hydromantes (Amphibia, Plethodontidae)."$"Senck.biol. 39(3/4): 155 - 163."$"3.069"

.. and this not:
Nowotne, F.$"1993"$"Die Verbreitung der Kreuzotter (Vipera berus) im Nord-Spessart$Mitteilungsblatt der Naturkundestelle Main-Kinzig 5 (2): 1-10$ 1740

You see the difference?
In the latter the doublequotes are missing at two Dollar-signs.
Would this be the error? But how I can change something here?

Mario

 

DebbieS

DaDaBIK Guru
Looks like it is not putting quotes around the proper "cells" of data. IN the first example, the quotes appear around the data in the first field where there are numerics and then continues to surround field data with quotes.

In the second sample, it starts to do the same, but seems to lose it when the $ between Nord-Spessart$Mitteilungsblatt is encountered and there are no more quotes added. IN essence, this is making the entire portion after "1993"$" appear to be one cell of data.

I've no idea why the problem exists, but have you looked through the csv export code in business_logic.php? Perhaps there, you can specify to surround each field with quotes?

Sorry I can't be more help - I've never had a problem with export to CSV (other than changing it to export all fields including those not displayed on the results page).

 
Hello DebbieS,

first, your answer seems to be useless to me - so I have no real idea in php.

But when I checked the business_logic.php, I found this at line 3125 (my version):

// hack for mssql, an empty varchar ('') is returned as ' ' by the driver, see http://bugs.php.net/bug.php?id=26315

After reading this, I have got it!!

No empty fields. In all empty fields I have now the "is equal" character "=".

And NO "returns" within the fields, also no "hidden" one, e.g. at the end of the entry.

So thank you again, it works perfect now!

Mario

 
Top