Click to See Complete Forum and Search --> : [RESOLVED] Text file to MySQL


telmessos
12-24-2009, 07:11 AM
Hi all,

I need a simple ASP script to move some information from a txt file to a mysql database. The information on the text file is separated by tabs. I want to create a loop to split the each line from the tabs and write each line's result to MySQL database. I tried it but couldn't make it work.

Can anyone send me an example code with some dummy database field names?

Thanks
telmessos

Note: There are 5 tabs on each line and as you can understand 6 fields on MySQL database.

yamaharuss
12-24-2009, 07:35 AM
This is for MSAccess but same principle applies, just change your connection

http://www.aspjunction.com/articles/importtext.asp

telmessos
12-24-2009, 07:38 AM
thanks for the info. The example splits with | character. I don't know how to split one tab space. do you know ?

yamaharuss
12-26-2009, 10:05 AM
Read carefully..

strLinePart = split(strLine,"|") Split each part of the line using the delimiter

Change that character to whatever your delimiter is

telmessos
12-29-2009, 02:34 AM
Thanks for help