wish of those help Since a ; indicates a comment in an ini file, parse_ini_file() will correctly throw away everything behind a (non quoted) ;. For me it looks like you are misusing the ini format, thus if you want to obtain that information, you need to parse the file on your own, like this:
it should still fix some issue Your problem is in your logic. You keep on adding to the data to your $dataArray with every iteration, while the following statement in your code will set stingData to the imploded value of $dataArray ONLY IN THE LAST LOOP ITERATION. And at that point, $dataArray contains all the data values because you kept pushing to it for 3 iterations.
$stringData = rtrim(...)
$stringData = '';
for ($i = 0; $i < 3; $i = $i+1)
//init the array with every iteration.
$dataArray = array();
//push your values
$stringData .= rtrim(implode(';', $dataArray), ';');
$stringData .= "\r\n";
echo $stringData . "\n";
How do I deal with semicolon in a cell when the file I am uploading semicolon delimited?
Any of those help I am using load data infile to upload a 2gig csv file into mysql and getting some warnings that indicate that some of the cells include a semicolon when the actual csv file I am uploading is semicolon separated. , You have to mention the fields separated by in LOAD DATA command as:
LOAD DATA LOCAL INFILE 'abc.csv' INTO TABLE abc
FIELDS TERMINATED BY **';'**
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
will help you I have a csv file with column name separated by a semicolon. I want to append a column separated by a semicolon but it is getting separated by a comma while using csv.reader , If I understand you correctly, this should work here:
Empty CSV file produced when reading 1 row of tab delimited data and exporting to '+' delimited