Separating a string with first and last name into

Results 1 to 2 of 2

Thread: Separating a string with first and last name into

  1. #1
    Join Date
    Dec 1969

    Default Separating a string with first and last name into

    Sorry if this has been asked before; I&#039;m sure it has, I just can&#039;t find the answer in the multitude of questions already asked. <BR><BR>So I have the first name and last name already coming into me in a database as one value. I need to separate the 2 names into 2 different values for a different database application that is going to be imported into a commercial program that will process it. So how can I do it.<BR><BR>A side question that I&#039;ll have to worry about down the road: Is there a quick and dirty way to convert an Access database into a CSV file?<BR><BR>Thanks in advance.<BR>Mike

  2. #2
    Join Date
    Dec 1969

    Default Split

    &#060;%<BR>...<BR>fullname = Trim( RS("fullname") )<BR>names = Split( fullname, " " )<BR>firstname = Trim( names(0) )<BR>secondname = Trim( names(1) )<BR>...<BR>%&#062;<BR><BR>None of the Trim() functions in there are needed if you know that there are no extra (bogus) spaces in the names.<BR><BR>**********************<BR><BR>Access itself can produce a ".csv" file, I believe. Let me check...<BR><BR>Yeah, sure...under the FILE menu, choose EXPORT.<BR><BR>But I think you can also do it by specifying the proper kind of external database in JET SQL.<BR><BR>And, finally, it&#039;s *very* trivial to do it if you are happy with using TAB delimiters instead of commas. That&#039;s the default output of ADODB.RecordSet.GetString(). And depending on your data, you could use GetString() to create a variety of variations of CSV data. [The problems you run into with CSV: What happens if a field in the DB already has a comma in it? The solution is usually to put "..." around any such fields. But GetString would want to put "..." around every field. Is that usable in your situation? And, of course, TAB separated files have the same problem: What do you do if there is a TAB in some of your text data in the DB?]<BR><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