Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading a csv file, mapping its data before importing in DB

Status
Not open for further replies.

gmeunier

Programmer
Nov 6, 2000
9
FR
Hello,

Let's say I have a csv file done that way :
"Gerald";"Meunier";"2"
"Mitch";"Farris";"3"
"Erik";"Rapp";"2"

Before importing this set of data into a table, I want VBA to map my third field :

mapping matrix
---------------
"1" -> "young"
"2" -> "quite old"
"3" -> "very old"

What then would be imported in my table is then :
"Gerald";"Meunier";"quite old"
"Mitch";"Farris";"very old"
"Erik";"Rapp";"quite old"

Has anyone any idea how to do this?

Many thanks!

Gerald
 
Two ways. Either bring it into a temporary table and and then run an append query that converts and stores it or write code to manually bring the file in. I would choose option one... Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
How about a look up table. Or "if then" statements in a form or report.

Best regards,

Henr¥
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top