mysql - How to remove line break from LOAD DATA LOCAL INFILE query? -


i using query import data txt file table:

load data local infile '~/desktop/data.txt' table codes lines terminated '\n' (code) 

this working fine. when take in "code"-field, every entry has line break @ end. there way rid of this?

load data infile command not suitable data cleansing, may lucky. first of all, determine characters make 'line breaks'.

it possible, text file uses windows style line breaks (\r\n). in case use lines terminated '\r\n'. if line breaks consist of different characters, consistent across lines, include in line terminated clause.

if line break characters inconsistent, may have create stored procedure or use external programming language cleanse data.


Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -