ubuntu - MySQL import txt data -


i having problems mysql importing text database. .txt file looks this:

a.txt

pattern: 1  address: 18phqkzkzp6qumwuiddhj2yrgkzkrmv3j  privkey: 5jrpliecq57ijgfvgmme19v1f29zpkwwjtqinjjjpfytqa3zcby  pattern: 1  address: 18zvgu7k8wxanwgghdudhdzyrco7aevpbuu  privkey: 5jmap8qgujxdhwjhwgkw9fkiuweksdwzl73xu8ihay2fy3kjmn3    etc.... 

i want import txt. file database called bitcoin table a.txt. lines "pattern: 1" should disappear , table "a" should have 2 columns:" address , privkey" address prim. key.

mysql> load data local infile "/home/weber/desktop/a.txt" table  -> fields terminated ':'  -> lines starting 'address'   -> ignore 1 lines; 

seems not working well, mysql knowledge give me hint, thanks.

you seem think file can use more 1 line in text file row. need use 1 line per row.

try:

pattern:address:privkey 1:18phqkzkzp6qumwuiddhj2yrgkzkrmv3j:5jrpliecq57ijgfvgmme19v1f29zpkwwjtqinjjjpfytqa3zcby 1:18zvgu7k8wxanwgghdudhdzyrco7aevpbuu:5jmap8qgujxdhwjhwgkw9fkiuweksdwzl73xu8ihay2fy3kjmn3   

and not use "lines starting 'address'" in command. read @ http://dev.mysql.com/doc/refman/5.1/en/load-data.html or similar info on using properly.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -