By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,035 Members | 1,543 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,035 IT Pros & Developers. It's quick & easy.

Saving CSV file to read from php

P: n/a
Hi,

Let me explain what I am trying to do first. I want to upload a .csv
file from a form page to the redhat server.
Uploading is working fine, I could upload the .csv file to the server.
But when I open the uploaded file using VI editor in the server, I see
"^M" characters and all CSV formats are disappeared. Also "fgetcsv()"
function cannot tell the length of the columns because of the messed
CSV forrmats.

When I saved the .csv file as Windows format in MS Excel, oh I am
using MacBook, it keeps CSV format at the server, but php cannot
access the file.

Anyone have solution this problem?

Big thanks for your help.
Bless,
Jan 4 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Fri, 04 Jan 2008 20:27:02 +0100, shyee <we******@gmail.comwrote:
Hi,

Let me explain what I am trying to do first. I want to upload a .csv
file from a form page to the redhat server.
Uploading is working fine, I could upload the .csv file to the server.
But when I open the uploaded file using VI editor in the server, I see
"^M" characters and all CSV formats are disappeared. Also "fgetcsv()"
function cannot tell the length of the columns because of the messed
CSV forrmats.

When I saved the .csv file as Windows format in MS Excel, oh I am
using MacBook, it keeps CSV format at the server, but php cannot
access the file.

Anyone have solution this problem?
The ^M is afaik a representation or \r, so take care of proper line
endings (or strip \r). If your format also has 'disappeared', I can't tell
you anymore about it without any output, so show us what else is wrong. An
URL of some sample data could be more appriopriate as it may be a
character set issue.
--
Rik Wasmus
Jan 4 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.