Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Separating names from a single column to 2 columns

Separating names from a single column to 2 columns

Scheduled Pinned Locked Moved Database
csharpdesignjsontutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jkirkerx
    wrote on last edited by
    #1

    I'm probably in the wrong forum, But I made a huge mistake in a table design for Billing and Shipping addresses in relation to card processing. I made a single column called attention for the name. But card processors want a first and last name for Billing and Shipping, and a single column for card name. Opps! So now I have all these names in a single column. Name like Thomas Friedman Sr. Loopy Jose De SannaAna Margret Keeneman-Hassel Kenneth G. Tompson Jr. So I can do a split in vb.net, and split them up, but I'm not sure how to place them. Just looking for ideas before I write any code to do the job. Perhaps just take the first set of chars, and that's the first name, and then the rest is the last name?

    Kornfeld Eliyahu PeterK 1 Reply Last reply
    0
    • J jkirkerx

      I'm probably in the wrong forum, But I made a huge mistake in a table design for Billing and Shipping addresses in relation to card processing. I made a single column called attention for the name. But card processors want a first and last name for Billing and Shipping, and a single column for card name. Opps! So now I have all these names in a single column. Name like Thomas Friedman Sr. Loopy Jose De SannaAna Margret Keeneman-Hassel Kenneth G. Tompson Jr. So I can do a split in vb.net, and split them up, but I'm not sure how to place them. Just looking for ideas before I write any code to do the job. Perhaps just take the first set of chars, and that's the first name, and then the rest is the last name?

      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu Peter
      wrote on last edited by
      #2

      IMHO it is a issue you can not resolve with code... Human names - and the way they are written down - are reflecting the human brain - lack of any order... As long as you have only one whitespace in the name you can simply split it, but what should you do with those with more than two parts in it? There is no existing algorithm to take them apart...(And if you add international customers, you are in deep...) What I would advise is: 1. Change the design of the tables, when the existing name will go into new 'firstname' column for the beginning... 2. Create logical groups of the names and 2.a. Split the simples 2.b. Check for those with Mr., Msr., Jr. and so in it and split them 2.c. Scan remained names for groups and handle them individually 2.d. Handle manually the rest (hopefully not much)

      Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

      "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

      J 1 Reply Last reply
      0
      • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

        IMHO it is a issue you can not resolve with code... Human names - and the way they are written down - are reflecting the human brain - lack of any order... As long as you have only one whitespace in the name you can simply split it, but what should you do with those with more than two parts in it? There is no existing algorithm to take them apart...(And if you add international customers, you are in deep...) What I would advise is: 1. Change the design of the tables, when the existing name will go into new 'firstname' column for the beginning... 2. Create logical groups of the names and 2.a. Split the simples 2.b. Check for those with Mr., Msr., Jr. and so in it and split them 2.c. Scan remained names for groups and handle them individually 2.d. Handle manually the rest (hopefully not much)

        Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

        J Offline
        J Offline
        jkirkerx
        wrote on last edited by
        #3

        It's good to get a 2nd opinion on that, and you confirmed it. I did change the design to let the customer choose what is the first and last name, sounds dumb but practical. So I did a split and select or switch case 2, 3 and 4 - first last, first (1) last, first (1+) (1+), first (1) last (SR-JR) So out of 5000, I only had 30 Mexican names, that i did by hand. Thanks for the confirmation!

        Kornfeld Eliyahu PeterK 1 Reply Last reply
        0
        • J jkirkerx

          It's good to get a 2nd opinion on that, and you confirmed it. I did change the design to let the customer choose what is the first and last name, sounds dumb but practical. So I did a split and select or switch case 2, 3 and 4 - first last, first (1) last, first (1+) (1+), first (1) last (SR-JR) So out of 5000, I only had 30 Mexican names, that i did by hand. Thanks for the confirmation!

          Kornfeld Eliyahu PeterK Offline
          Kornfeld Eliyahu PeterK Offline
          Kornfeld Eliyahu Peter
          wrote on last edited by
          #4

          You're welcome...

          Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

          "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups