I have a .rpt file output from SSMS. I'm able to open it within a text editor or Excel, but format appears to be neither space, tab, or comma delimited, so resulting formatting in Excel isn't correct.
I've had similar issues loading to MySQL using the LOAD DATA INFILE
call.
Namely, the load 'completes', but the majority of rows/columns are skipped due to apparent formatting discrepancies.
Input:
EffectiveDate family Instrument SedolCode Name ICB QZ VZ MZ SZ volZ LZ DYZ QS VS MS SS volS LS DYS price_o fx_o shares cap_o_usd
----------------------- ------ ----------- ------------ ------------------------------------------------------------ ----------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ----------------------
1998-03-23 00:00:00.000 RU1000 1010846 2046789 Arco Chemical 1 0.332041753946526 3 -0.701907649892818 0 1.12824639032619 1.25544514744965 1.60431785387846 0.630071248806063 0.998650187313827 0.241368465365155 0.5 0.870392090484651 0.895341500804304 0.945678041846726 48.56 1 16794000 815555357.27
1998-03-23 00:00:00.000 RU1000 1004415 2048804 Pinnacle West Capital Corp 7 0.197368136475134 0.295748219600254 0.0886833678439797 0 1.05597173533583 -0.0327467636082814 0.75373010240488 0.578230241112579 0.616288903631446 0.535333094702153 0.5 0.854509410778738 0.486938352167234 0.774494234589535 44.44 1 84718000 3764645032.54
1998-03-23 00:00:00.000 RU1000 1003705 2050832 Ameren Corp 7 0.482269760349473 -0.0732144149931671 -0.623013812458784 0 1.29932391788085 -0.218587562254685 1.72709462374024 0.685192934274198 0.470817875898523 0.266637746506796 0.5 0.903083725664561 0.413485670414547 0.9579246320922 42.31 1 137215000 5805918920.82
Table format:
create table myTable(
effectiveDate DATE NOT NULL,
family CHAR(6) NOT NULL,
instrument INT NOT NULL,
sedol CHAR(8),
name VARCHAR(100),
icb INT,
QZ DOUBLE,
VZ DOUBLE,
MZ DOUBLE,
SZ DOUBLE,
volZ DOUBLE,
LZ DOUBLE,
DYZ DOUBLE,
QS DOUBLE,
VS DOUBLE,
MS DOUBLE,
SS DOUBLE,
volS DOUBLE,
LS DOUBLE,
DYS DOUBLE,
priceO DOUBLE,
fxO DOUBLE,
capOUSD DOUBLE,
PRIMARY KEY (effectiveDate, instrument));
Load call
load data infile '/ru/z1.rpt'
into table myTable
(effectiveDate, family, instrument, sedol, name, icb, qz, vz, mz, sz, volz, lz, dyz, qs, vs, ms, ss, vols, dys, priceO, fxO, @dummy, capOUSD);