Quote comma Quote Split

Results 1 to 2 of 2

Thread: Quote comma Quote Split

  1. #1
    Join Date
    Dec 1969
    Posts
    241

    Default Quote comma Quote Split

    I have a CSV file which is quote comma quote delimited which I am reading into a database. However, once I have read in the string I can split it via the comma and its put into an array nicely. However, I have found that my data isn&#039;t consistent and the suppliers of the file have done the following :<BR><BR>"Sample Company,","Sample Town"<BR><BR>So I have an extra comma to contend with at times<BR><BR>I tried the split(mystring, ",") but this gives me too many fields and I tried split(mystring, "","") but this wasn&#039;t accepted. I have looked around and played with regular expressions but they still give me too many fields due to this extra comma in the string.<BR><BR>Can you please help as I have been working on this all day.

  2. #2
    Join Date
    Dec 1969
    Posts
    96,030

    Default """,""" ... really

    To embed a " inside a string in VBScript, you have to use a pair of " marks.<BR><BR>So:<BR> " -- begins the string<BR> "" -- a single quote mark inside the string<BR> , -- a comma inside the string<BR> "" -- a single quote mark inside the string<BR> " -- ends the string<BR><BR>

Posting Permissions

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