Results 1 to 7 of 7

Thread: Convert xls to csv remove double quotes

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Location
    San Isidro
    Posts
    326

    Convert xls to csv remove double quotes

    Hi can anyone help me? i am converting my xls file to csv file. I was able to convert my xls to csv
    successfully but when i upload it to my online system created in php it says this is not a csv file.

    This is because of the double quotes inside my CSV file

    1, "alicia", "#61"

    How can i remove double quotes in my xls file.


    PLEASEE HELP!!!
    I want to learn more
    grace

  2. #2
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Convert xls to csv remove double quotes

    You could use the REPLACE function

    The next example will replace the doublequotes to spaces
    Code:
    SomeStr = Replace(SomeStr, Chr(34), "")
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Location
    San Isidro
    Posts
    326

    Re: Convert xls to csv remove double quotes

    thanks for the reply. I will try that
    I want to learn more
    grace

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Location
    San Isidro
    Posts
    326

    Re: Convert xls to csv remove double quotes

    is there other way aside from changing my code? how about in excel 2010 is there techniques to convert xls to csv without having a double quotes after converting?
    below is the code in php if i have double quotes it says this is not a php file.

    if($_FILES["file"]["type"] != "application/vnd.ms-excel"){
    die("This is not a CSV file.");
    }
    elseif(is_uploaded_file($_FILES['file']['tmp_name'])){
    ...actions
    }
    Last edited by VBcielle; Feb 4th, 2013 at 10:22 PM.
    I want to learn more
    grace

  5. #5
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Convert xls to csv remove double quotes

    Just save the excel file as .csv
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Location
    San Isidro
    Posts
    326

    Re: Convert xls to csv remove double quotes

    Quote Originally Posted by jggtz View Post
    Just save the excel file as .csv
    It has double quotes 1, "reyes", jing when i just save as csv.
    I want it to look like 1, reyes, jing.
    I want to learn more
    grace

  7. #7
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: Convert xls to csv remove double quotes

    well first, this won't work
    if($_FILES["file"]["type"] != "application/vnd.ms-excel"){

    as it's not an Excel file... it's a CSV... a text file. The reason you're getting the quotes is because the fields are text, which have the potential to contain commas themselves... so it puts the quotes on there so that it gets treated as a single field.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width