Hi all,
Ther is a carriage returns in the text of one of string fields in a coloumn.
Eg: PAY SLIP is the value of a field. SLIP is going to the next row as there
is a carriage retrun after PAY.
I need to remove this carriage return from the feild.
Please help.
Regards
Siraz.
remove carriage return
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
Convert(Char(10):Char(13),"",InLink.ColumnName)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
You might be able to use the CONVERT function, like I've recently done but in the 'opposite' direction (I wanted to convert comma to line feed).
Since CR is not a character you can type into a derivation field you also need to use the CHAR function and feed it with the ASCII number for CR (13).
So try writing CONVERT(Char(13),"",<in_string>) where <in_string> is the string that contains CR. I assume you just want to remove CR, hence the empty string "", else just put anything you want to replace CR with between the quotes.
Since CR is not a character you can type into a derivation field you also need to use the CHAR function and feed it with the ASCII number for CR (13).
So try writing CONVERT(Char(13),"",<in_string>) where <in_string> is the string that contains CR. I assume you just want to remove CR, hence the empty string "", else just put anything you want to replace CR with between the quotes.
-
- Participant
- Posts: 84
- Joined: Thu Dec 04, 2003 9:55 pm
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
EREPLACE is less efficient than CONVERT where appropriate to use it.
CONVERT performs character-by-character conversion.
EREPLACE replaces one substring with another.
You can use CONVERT to replace single characters with other single characters, including "".
However, if you want to replace one or more characters with more than one character, you need to use EREPLACE.
CONVERT performs character-by-character conversion.
EREPLACE replaces one substring with another.
You can use CONVERT to replace single characters with other single characters, including "".
However, if you want to replace one or more characters with more than one character, you need to use EREPLACE.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.