Ask Your Question
0

BASE - Problem importing carriage returns in csv file.

asked 2017-04-03 04:23:51 +0200

Justin100 gravatar image

Does anyone happen to know the SQL code needed in LO Embedded Base to convert some specific text expression back to line feeds and or carriage returns?

I have data in a csv file that contains a large text field with carriage returns an/or line feeds. I can easy convert the carriage returns/line feeds to “some unique text expression” such as “XYZ123”. That way, the line feeds are removed and the field exports as one long line.

Importing to base is easy but I would then like to reconvert the ““XYZ123” expressions, or some other expressions if suggested, back to carriage returns.

Hope this makes sense. BTW I have tried multiple different SQL code samples using CHAR(10), CHAR(13), /r /n etc without luck. All help is appreciated! Thanks!!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2017-04-06 00:26:56 +0200

Justin100 gravatar image

updated 2017-04-06 13:58:33 +0200

Perhaps I did not express my question very well but I was able to find the answer needed. For those who may be interested the SQL code in LO Base Embedded to change some arbitrary text (say XYZ) in a field (or column), to a line feed (carriage return), is as follows:

update TABLE set COL = replace(COL, 'XYZ', CHAR(13)) ;

For example: This is a test.XYZThis is a test.

Changes to:

This is a test.

This is a test.

Hope this helps someone else trying to do the same thing I was.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-04-03 04:23:51 +0200

Seen: 174 times

Last updated: Apr 06 '17