If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Replacing new line characters

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-09-07, 15:52
samu78nyc samu78nyc is offline
Registered User
 
Join Date: Nov 2006
Posts: 31
Replacing new line characters

Hi all,
I am using a "DB2 v8.1.1.96" on AIX.

I have select statement to select the below columns.

TABLE ABC.A :

ID VARCHAR(60)
PROBLEM_NO VARCHAR(60)
PROBLEM LONGVARCHAR(32700)

db2 "EXPORT TO data.dat OF del modified by coldel| select ID, PROBLEM_NO, PROBLEM from ABC.A with ur;

cat data.dat | sed "s/\"//g" > data.txt

The issue is I am having multiple lines for the same record in data.txt file as the PROBLEM column have new line characters.
Is there a way to use any REPLACE functions are any other way so that the text file has each record in a single line.

Thanks all...
Reply With Quote
  #2 (permalink)  
Old 05-09-07, 16:01
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
REPLACE(REPLACE(MyCol,chr(10),' '),chr(13),' ') should get you there.

Andy
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On