B
Bob Johnson
Using C#/2.0 I'm writing a small "data translator" utility app that reads
data out of a MS Access database and inserts it into a SQL Server database.
The source db lists a bunch of names of people (the particular table
structure is not relevant to this post). We need to identify the gender of
the people as best as we can. We currently have two text files
(MaleNames.txt and FemaleNames.txt) that list typically male or female
names, respectively. So "Scott" would be found in MaleNames.txt and "Julie"
would be found in FemaleNames.txt. There are hundreds of names in each
list/file. Of course some names like "Pat" and "Terry" could easily be
either - so are excluded from this translation process (names migrated, but
no sex specified).
My question:
I'd appreciate some suggestions for matching names with a gender "Male" or
"Female" - and do this matching in the C# utility app.
PCode for the end result I'm after would be something like this:
if (firstName [is in the list of MaleNames])
{
mySqlParm named "Gender" = "Male"
}
else
{
if (firstName [is in the list of FemaleNames])
{
mySqlParm named "Gender" = "Female"
}
else
{
mySqlParm named "Gender" = DBNull.Value
}
}
Thanks!
data out of a MS Access database and inserts it into a SQL Server database.
The source db lists a bunch of names of people (the particular table
structure is not relevant to this post). We need to identify the gender of
the people as best as we can. We currently have two text files
(MaleNames.txt and FemaleNames.txt) that list typically male or female
names, respectively. So "Scott" would be found in MaleNames.txt and "Julie"
would be found in FemaleNames.txt. There are hundreds of names in each
list/file. Of course some names like "Pat" and "Terry" could easily be
either - so are excluded from this translation process (names migrated, but
no sex specified).
My question:
I'd appreciate some suggestions for matching names with a gender "Male" or
"Female" - and do this matching in the C# utility app.
PCode for the end result I'm after would be something like this:
if (firstName [is in the list of MaleNames])
{
mySqlParm named "Gender" = "Male"
}
else
{
if (firstName [is in the list of FemaleNames])
{
mySqlParm named "Gender" = "Female"
}
else
{
mySqlParm named "Gender" = DBNull.Value
}
}
Thanks!