Results 1 to 9 of 9

Thread: [RESOLVED] Ingoring comma, where comma is the delimiter VBA (access)

Threaded View

  1. #1

    Thread Starter
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Resolved [RESOLVED] Ingoring comma, where comma is the delimiter VBA (access)

    I am having a problem; I have a string as follows:

    FirstName,LastName,PostalCode,"some address, with comma", whatever


    I am using the split function to break it down into an array. The problem I am having, is the array comes out like this:

    FirstName
    LastName
    PostalCode
    "some address
    with comma"
    whatever



    The output I would like, is to have it like this

    FirstName
    LastName
    PostalCode
    "some address, with comma"
    whatever

    All addresses that contain commas will be encased with ".

    *edit*
    Sorry, It is not just the address that may contain commas, any field may. Although any field wit a comma that is not meant to be used as a delimiter will be encased in "'s.
    *end edit*

    I am reading the string in 1 line at a time before I actually split by the delimiter.

    Sorry I cant post any code, as I am at work atm..but pseudocode is

    VB Code:
    1. Do While NOT EOF
    2.   textLine = ReadLine (bleh.txt)
    3.   splitLinex = Split(textline,",")
    4. Loop

    Thanks,

    Smitty
    Last edited by kfcSmitty; Jun 16th, 2006 at 12:49 PM.

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