Parsing a comma delimited string

Results 1 to 3 of 3

Thread: Parsing a comma delimited string

  1. #1
    Nick Rosado Guest

    Default Parsing a comma delimited string

    I am using a dll that returns a comma delimited text string back to me after procesing. Now I need to parse it and pass it along. Does anyone have any sample code on how to parse and make this string functional?

  2. #2
    Join Date
    Dec 1969

    Default RE: Parsing a comma delimited string

    here&#039s a very simple built in function<BR>split(string, ",")<BR>The function needs a string and what you want to split it up with. It then returns to you a string array.<BR>So an example would be <BR><BR>Dim arrTemp(), strTemp<BR>strTemp = "FirstName, LastName, Address"<BR>arrTemp = split(strTemp, ",")<BR>&#039It would return to you<BR>arrTemp(0) = "FirstName"<BR>arrTemp(1) = "LastName"<BR>arrTemp(2) = "Address"<BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Parsing a comma delimited string

    Use the Split(String,"delimeter") function.<BR><BR>Something Like<BR><BR>&#039get your string<BR>myVar=yourCommaDelimitedString<BR>&#039t his splits up your string into an array.<BR>myArray=split(myVar,",")<BR>&#039your data is now in an array that can be expressed as<BR>&#039myArray(0),myArray(1)<BR>&#039if your data that is passes is supposed to be in database form<BR>&#039then use the following<BR><BR>myColumns=totalNumberOfColumns<BR >&#039get the number of variables<BR>myMax=Ubound(myArray)<BR>&#039declare the 2 demensional array<BR>Dim myTable(Int(myMax/myColumns)-1,myColumns)<BR>&#039loop through inputing data<BR>for x=0 to myMax<BR> for x=0 to myColumns<BR> &#039put the info in<BR> next<BR>next<BR><BR>sorry about that last part, I have to go.<BR><BR>B.<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