Home » SQL & PL/SQL » SQL & PL/SQL » How to remove line breaks and put it in excel (Oracle11g)
How to remove line breaks and put it in excel [message #675962] Thu, 02 May 2019 04:37 Go to next message
ssyr
Messages: 58
Registered: January 2017
Member
Hi all,

Could you please help me to resolve my below issue.
I am getting line break in column data so I have used regexp_replace function as given below.
When I ran this sql developer it runs properly. But when I have created .csv file .In that file some data is going to other column .Can anyone helps me how can I resolve this issue.

my Query:
select regexp_replace(replace('Jaybird Freedom /
Freedom 2 CHARGING CLIP / BATTERY PACK - Blaze','"','""'),'[[:space:]]+', chr(32))as Samaple_1,
from dual;

Oracle11g
Re: How to remove line breaks and put it in excel [message #675964 is a reply to message #675962] Thu, 02 May 2019 06:54 Go to previous messageGo to next message
cookiemonster
Messages: 13628
Registered: September 2008
Location: Rainy Manchester
Senior Member
We'd need to know what the data that's going into another column actually is.
Open the csv in a text editor and have a look what the problematic data is.
Re: How to remove line breaks and put it in excel [message #675967 is a reply to message #675964] Thu, 02 May 2019 07:34 Go to previous messageGo to next message
ssyr
Messages: 58
Registered: January 2017
Member
Hi ookiemonster ,thank you for looking my issue.

I am uploading the same data after removing the white space in .csv file. But file is generated using shell script in Linux.
Re: How to remove line breaks and put it in excel [message #675968 is a reply to message #675967] Thu, 02 May 2019 08:00 Go to previous messageGo to next message
cookiemonster
Messages: 13628
Registered: September 2008
Location: Rainy Manchester
Senior Member
That doesn't tell us anything useful.
What characters are causing problems?
What exact code is used to generate the file?
Re: How to remove line breaks and put it in excel [message #675969 is a reply to message #675968] Thu, 02 May 2019 08:38 Go to previous messageGo to next message
Bill B
Messages: 1868
Registered: December 2004
Senior Member
If you have the data in a table column then simply use the dump(column_name) to see the exact characters in the string
Re: How to remove line breaks and put it in excel [message #676003 is a reply to message #675969] Sun, 05 May 2019 23:44 Go to previous messageGo to next message
ssyr
Messages: 58
Registered: January 2017
Member
Hi Bill,

My actual issue is my query output is coming in correct format in excel file. Please see in attached file. In that product_name column data is shifted into Quantity column.


  • Attachment: Error.jpg
    (Size: 7.58KB, Downloaded 48 times)
Re: How to remove line breaks and put it in excel [message #676008 is a reply to message #676003] Mon, 06 May 2019 06:01 Go to previous message
Bill B
Messages: 1868
Registered: December 2004
Senior Member
Check your csv file for that row. I guarantee that you will find an extra comma in one of the fields. a better way would be to use tab delim,ited instead of comma delimited
Previous Topic: parent value of xmlquery
Next Topic: Package transfer from one to other oracle database
Goto Forum:
  


Current Time: Mon Jun 17 14:03:58 CDT 2019