Problem with LOAD DATA INFILE: Jumping of Records

0

I am migrating a Sybase 15.5 database to MySQL 5.7.

As I do not have any appropriate tools I am using the bcp to extract data from Sybase and the LOAD DATA INFILE to load them in MySQL.

Export from Sybase:

bcp BBDD..TABLA out TABLA.bcp -A2048 -c -t '&^' -r ''\r\n'' -T 33554432 

Putting as field separator '&^' and separator row '\r\n' .

Import from MySQL:

LOAD DATA LOCAL INFILE 'TABLA.csv into table TABLA
    -> FIELDS TERMINATED BY '&^'
    -> LINES TERMINATED BY '\r\n'

But I only upload 1 record. ( there are 200000 records to be migrated )

The model of the file .bcp with the data to extract is:

145431056412&^[email protected]&^27124&^FI&^ &^R&^000000000000&^ &^00333&^000&^9202&^00333000082770021452ACF&^002011724&^R&^ &^216029000445&^Feb  1 2016  8:09
:24:126AM&^<HTML>
<HEAD>
 <TITLE>Notificación MiFID</TITLE>
</HEAD>
<BODY bgcolor="#c8c8c8" bottomMargin=0 leftMargin=0 topMargin=0 rightMargin=0 marginheight="0" marginwidth="0">
<table bgcolor="#808080" width="100%" height="100%" cellspadding="0" cellspacing="0">
  <tr>
    <td><table width=750 border=0 align=center cellpadding=0 cellspacing=0 bgcolor="#ffffff">
      <tbody>
        <tr bgcolor="#808080">
          <td colspan=3 align="center" style="FONT: 500 11px Arial,Helvetica,sans-serif;COLOR: #ffffff">&nbsp;</td>
        </tr>
        <tr>
--aqui va el cuerpo del html, no lo pego todo porque es muy largo, y continuacion las lineas finales
</TR>
          </TBODY>
        </TABLE>
  </tr>
</table>
</BODY>
</HTML>
\r\n145431056414&^[email protected] ---->aqui empieza el segundo registro

When processing the command, it only loads the first record ignoring the rest.

I tried to put '\r\n' , '\n' , '~\r\n' but none of the forms worked.

    
asked by ekom77 06.06.2017 в 16:32
source

0 answers