I wasn't quite sure where to post this so I'm sorry if it's in the wrong category. I have a great deal of data I need to enter into my database which starts in the form xxxxxx:xxxxxx where the x's always vary in length and there is always a ":" dividing the two parts of data. I need to seperate these two parts of data and have the first part before the ":" go into one row and the second half after the ":" go into another row (both rows in same table)...the ":" can be discarded. I'll be adding this data manually by uploading a txt file to the database in the form of:

xxxx:xxxx
xxxxxxxx:xx
xxxxxxx:xxxxxxx
xxx:xxxxxxx

I have no idea how I would go about doing this. It would really save me time if it was possible to code a small script that automatically does this everytime I upload a txt file. Any help would be greatly appreciated!

raf

08-04-2006, 07:15 AM

you should at least tell us what server side language that you use....

below code will read in the file, and then for each line, it will split the value into pieces on the ':' (can be 0, 1 or more pieces).
it will then insert a new record for each piece.