Page 1 of 1

Export data into csv issue.

Posted: Thu Aug 14, 2014 8:53 am
by vinodkumar
Hi sir,
In cakephp we are using one CsvComponent.
Can i put comma(,) as a third parameter into fputcsv function then any problem is there?
why because i am facing some small issue in exporting data into csv.if i passed other than comma(,) as a third parameter in fputcsv function like semicolon(;) then i am facing issue.That is if any field value with comma,then after that those data what ever it is not coming into csv file.Please clarify my dought as soon as possible.i am waiting for your reply.

Thanks & Regards,
VinodKumar.

Re: Export data into csv issue.

Posted: Thu Aug 14, 2014 9:18 am
by Celauran
vinodkumar wrote:if i passed other than comma(,) as a third parameter in fputcsv function like semicolon(;) then i am facing issue
Semicolon, pipe, or whatever should work fine. Can you please elaborate on the problem you're facing?

Re: Export data into csv issue.

Posted: Mon Aug 18, 2014 12:16 am
by vinodkumar
can i use comma as a csv delimiter(third parameter) in fputcsv() function in php?
Please let me know.

Re: Export data into csv issue.

Posted: Mon Aug 18, 2014 6:23 am
by Celauran
Comma is the default parameter.

Re: Export data into csv issue.

Posted: Mon Aug 18, 2014 8:01 am
by vinodkumar
1) I am fetching the data from database and export into csv file.while i am fetching the data from database if any column value has special character like comma(,) then after that column remaining data for particular record is not coming into csv. I was used csv delimiter as a semicolon(third parameter) in fpucsv() function.

2) In above case the data is not coming into csv file.

Please let me know.