New Line Character

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
pklcnu
Premium Member
Premium Member
Posts: 50
Joined: Wed Aug 06, 2008 4:39 pm

New Line Character

Post by pklcnu »

Dear Experts

My requirement is like this

In the csv file the record is like

"abc","bbc \n xyz ", "efg"
"abc2","bbc2 \n xyz2 ", "efg2"

Then after loading in to the table the data should look like

Col1 Col2 Col3
abc bbc efg
xyz

abc2 bbc2 efg2
xyz2


Is it possbile to do this........i mean the new line character \n needs to be converted in to the new line in the in the Col2.

Thanks
pklcnu
Premium Member
Premium Member
Posts: 50
Joined: Wed Aug 06, 2008 4:39 pm

Re: New Line Character

Post by pklcnu »

Hi

I am loosing the format when I am posting it......so the format that I sent in my earlier post is not correct........my question is how I can replace \n with new line . One of the column is having the data which conatin \n which needs to be converted in to a different line........suppose if i got "abc \n bbc" then the data has to be converted into two lines the first line is "abc" and second line "bbc'' . But both of them in the same record and same column.........how do i achieve this.......Many thanks

pklcnu wrote:Dear Experts

My requirement is like this

In the csv file the record is like

"abc","bbc \n xyz ", "efg"
"abc2","bbc2 \n xyz2 ", "efg2"

Then after loading in to the table the data should look like

Col1 Col2 Col3
abc bbc efg
xyz

abc2 bbc2 efg2
xyz2


Is it possbile to do this........i mean the new line character \n needs to be converted in to the new line in the in the Col2.

Thanks
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Re: New Line Character

Post by priyadarshikunal »

Use code tags to preserve the format.


pklcnu wrote:
My requirement is like this

In the csv file the record is like

Code: Select all

"abc","bbc \n xyz ", "efg"
"abc2","bbc2 \n xyz2 ", "efg2"
Then after loading in to the table the data should look like

Code: Select all

Col1  Col2  Col3
abc   bbc    efg
      xyz
abc2  bbc2   efg2
      xyz2

Is it possbile to do this........i mean the new line character \n needs to be converted in to the new line in the in the Col2.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Why in this world you want to do that? First I will suggest to double check the requirements.

Do you have to put the value after \n in the next row or you just want to convert \n to a newline?
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

1.keep a column number indicator where you have \n
2.Redirect these values to a different file
4.Load it as another job
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Sreenivasulu wrote:1.keep a column number indicator where you have \n
2.Redirect these values to a different file
4.Load it as another job
you missed point 3 :wink:

also you can change point 2 & 3 to
1. redirect the values to different stream. since you don't need other values set it as null in transformer downstream.
3. funnel and load.

only thing that makes me worry is the use of newly created row. :?
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
pklcnu
Premium Member
Premium Member
Posts: 50
Joined: Wed Aug 06, 2008 4:39 pm

Post by pklcnu »

Convert('\n',char(10),ColumnName) Solved the issue......thanks every one
Post Reply