+ Reply to Thread
Results 1 to 4 of 4

CSV adding double quotes to one column

  1. #1
    Registered User
    Join Date
    03-11-2019
    Location
    UK
    MS-Off Ver
    2017
    Posts
    2

    CSV adding double quotes to one column

    Dear all,

    Apologies if this is the wrong place to post this query, but I am currently at my wits end trying to solve an issue within excel.

    I've had to generate 1000 entries with a php script of users with their details and their passwords in the form of a hash (MD5). I need to save the excel document as a CSV file to get the commas between columns. Each field has the single quotes needed for an SQL query. However, the hash column which is the last in the table saves in CSV with double quotations around the single quotes and as you can imagine, this doesn't wash with SQL. I have no idea what is causing it or how to remove them being a novice in excel. I would massively appreciate any help anyone could provide.

    (1 'guest' 'Chung Kristina H.' '895547922' '1' '52e411e104fc396f487c1d0688118c55'),

    (these are dummy names and passwords by the way, this is a university project). The formatting above is correct other than when saved into the CSV file and opened in a text editor (which I need to do) double quotes appear around the last column. I don't know what to do?

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: CSV adding double quotes to one column

    Hi, welcome to the forum
    How are you inserting the single quotes?
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    03-11-2019
    Location
    UK
    MS-Off Ver
    2017
    Posts
    2

    Re: CSV adding double quotes to one column

    Quote Originally Posted by Keebellah View Post
    Hi, welcome to the forum
    How are you inserting the single quotes?
    Hi, thank you

    I inserted the single quotes from a PHP script. I had to manually add the single quotes in the script for the 1000 hashes so that SQL would understand the syntax. I then opened the plain text of that script result in excel. It looks right in excel, each column has the single quotes. For whatever reason, when I save as a CSV (Which I need to open in plain text to paste into SQL) it adds double quotes around the single quotes for the hash/password column. I really don't get it lol.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: CSV adding double quotes to one column

    That's Excel for you, you do NOT open text files in Excel but use Notepad or similar instead, check it there

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Adding double quotes for string in formula
    By Vlad717 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-28-2017, 12:42 PM
  2. [SOLVED] Save to a CSV with Double Quotes EXCEPT the Second Column with NO Quotes
    By tkuy2k in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-16-2013, 09:54 AM
  3. Save to a CSV with Double Quotes EXCEPT the First Column with NO Quotes
    By justforthis1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-13-2013, 07:02 PM
  4. [SOLVED] Double Quotes using Chr(34) and Extra Quotes when saving as text file
    By vamosj in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-26-2013, 12:26 PM
  5. Replies: 4
    Last Post: 12-29-2010, 11:41 AM
  6. Replies: 2
    Last Post: 07-29-2009, 11:06 AM
  7. Setting a cell's value as a formula containing quotes or double quotes using vba
    By Metshrine in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2006, 04:10 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1