I have a .txt file that has a bunch of formatted data in it that looks like the following:
...
1 75175.18 95128.46
1 790890.89 795829.16
LOAD DATA
CHARACTERSET AL32UTF8
INFILE 'DCF Master 14APR2013 VSPCFM_reduced size.txt'
INTO TABLE EMPLOYEE3
(
a = TRIM(SUBSTR(@row,1,11)),
b = TRIM(SUBSTR(@row,33,38)),
c = TRIM(SUBSTR(@row,70,86))
)
These are what we call "fixed-width" records and LOAD DATA doesn't play well with them. Options:
SUBSTR()
and TRIM()
to slice out the columns you need into the final table.LOAD DATA LOCAL INFILE
'/some/Path/segmentation.txt'
INTO TABLE clip
(@row)
SET slideNum = TRIM(SUBSTR(@row,1,4)),
startTime = TRIM(SUBSTR(@row,5,13)),
endTime = TRIM(SUBSTR(@row,18,13))
;