Tuesday, 6 August 2013

Convert Text File To MySQL Database

Convert Text File To MySQL Database

I have .txt file that is about 20MB in size. Each Line looks like the
following.
*,00000000,Binary Zero,Description
*,00000001,Binary One,Description
*,00000010,Binary Two,Description
*,00000011,Binary Three,Description
*,00000100,Binary Four,Description
*,00000101,Binary Five,Description
*,00000110,Binary Six,Description
*,00000111,Binary Seven,Description
*,00001000,Binary Eight,Description
*,00001001,Binary Nine,Description
*,00001010,Binary Ten,Description
What I want to do is convert it to mysql database where the astericks will
be replaced with an auto increment number called id. And the commas would
be where a new field starts. How do I go about doing this?

No comments:

Post a Comment