mysql - Inserting data from text files into pre-existing columns -
i trying insert data text file (18.9gb large) looks this:
as8dyta89sd6892yhgeui2eg
asoidyaos8yd98t2y492g4n2
as8agfuigf98safg82b1hfdy
they length of 32 characters. have database named hashmasher , table called combinations columns named unhashed , sha256. have data stored in unhashed columns. looking like:
unhashed | sha256
data | (completely empty)
now wondering, how insert data existing columns aswell adding data second column, example above become
unhashed | sha256
data | firstlineoftextfile
data | secondlineoftextfile
if use load data infile load new rows (that's i've been told) , load unhashed column aswell sha256 column.
tl;dr want insert data text file second column of pre-existing rows.
insert data load data infile new table. may temporary, speed thing bit. use insert ... select ... join merge 2 tables.
i understand can take few hours 19g table.
things more complicated, since original file contains 1 value per row. may want fix sed/awk script there 2 values per row, load data infile works.
the other approach go on sed/awk scripting, , convert original file file bunch of update statements, , pipe result mysql.