Page 1 of 1
New Line Character
Posted: Tue Feb 02, 2010 5:39 am
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
Re: New Line Character
Posted: Tue Feb 02, 2010 7:05 am
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
Re: New Line Character
Posted: Tue Feb 02, 2010 8:41 am
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.
Posted: Tue Feb 02, 2010 8:46 am
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?
Posted: Tue Feb 02, 2010 1:00 pm
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
Posted: Wed Feb 03, 2010 3:54 am
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
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.
Posted: Sat Feb 13, 2010 2:12 am
by pklcnu
Convert('\n',char(10),ColumnName) Solved the issue......thanks every one