Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help replacing "," with '\n'

Author  Topic 

dyhr
Starting Member

1 Post

Posted - 2014-03-11 : 04:31:51
Hello everyone!

What I'm trying to achieve is to have a new "line" everywhere where the ","(comma) letter is...

This is my output now;
C:\Över,C:\Övervakning,C:\Ängelholm,C:\Förening,

And I would liked it to be like this;
C:\Över,
C:\Övervakning,
C:\Ängelholm,
C:\Förening,

When I use this command line:
SELECT `value` FROM extrafielddata WHERE extrafieldID = 522 and id = 1 INTO OUTFILE '/Test/test.csv' FIELDS TERMINATED BY ','ESCAPED BY '\n' LINES TERMINATED BY '\n';

I get this result when I open the file:
C:\Över
,C:\Övervakning
,C:\Ängelholm
,C:\Förening

So I get the "comma (,)" letter first, but I want it last..:(

Can anyone help me out?
Thanks in regards!!
Filip

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2014-03-11 : 05:21:53
This looks like MySQL syntax to me
So I would say you're in wrong forum. This is MS SQL Server forum. You may better off posting this in some MySQL related forum to get specific syntax help

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -