Re: Saving CSV file to read from php



On Fri, 04 Jan 2008 20:27:02 +0100, shyee <webophir@xxxxxxxxx> wrote:

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
.



Relevant Pages

  • Saving CSV file to read from php
    ... Uploading is working fine, I could upload the .csv file to the server. ... When I saved the .csv file as Windows format in MS Excel, ...
    (comp.lang.php)
  • Re: Good sftp server?
    ... FDL on the files that I upload to convert it into STREAM_LF format. ... > it except for the sftp server, ...
    (comp.os.vms)
  • Adding multiple users from a text file?
    ... Is it possible to add 25 users to an SBS 2003 server by pulling their names, ... email addresses, passwords, etc, from a CSV or other format text file? ...
    (microsoft.public.windows.server.sbs)
  • Upload and process CSV File
    ... processed on server side (transform and insert the data from the csv in the ... csv upload works only when done from the server (localhost). ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Uploading From A CSV File
    ... CSV format. ... We then need to upload these into an AS400 file using ... Are you sure that they are stored in the CSV file as 1.2345E+11, I ask this because if you open a CSV in Excel, it will display very large numbers in this format if the column isn't large enough. ...
    (comp.sys.ibm.as400.misc)