/*****************************
      create Temp 
*****************************/    
drop table if exists d40_std; 
/*peg_end*/
create table d40_std
SELECT *
from d40
where nr01=-1; 
/*peg_end*/

delete from d40_std;
/*peg_end*/

/*************************
     upload to temp 
**************************/
LOAD DATA LOCAL INFILE '{my_file}'
INTO TABLE d40_std
LINES  TERMINATED BY '\n' 
(@col01)

SET p02 = substr(@col01, 1, 5), 
    p01 = substr(@col01, 6, 40), 
    p03 = substr(@col01, 6, 300);
/*peg_end*/

update d40_std set p01=replace(p01, char(13), '');
/*peg_end*/
update d40_std set p01=replace(p01, char(10), '');
/*peg_end*/


