on 08-31-2011 2:15 PM
Hi Experts,
I am getting carriage returns in one of the source field, i need to remove those carriage returns and i need to pass it to target field, can anyone suggest me how can i achieve this.
Have you tried with REPLACE function, replacing carriage return character with NULL?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
String var2 = var1.replaceAll("\n\r", "");
return var2;
This UDF has two problems:
1. In windows it is \r\n (carriage return and line fed). It is not \n\r.
2. Better to use new line system property rather than hard coding new line characters.
Please use this UDF.
public String replaceNewLine(String inputVar, Container container) throws StreamTransformationException{
String newLine = System.getProperty("line.separator");
return inputVar.replaceAll(newLine, "");
}
Regards,
Raghu_Vamsee
Hello,
Are you getting only CR or CR+LF (line feed) ?
In this case - CRLF - you can use content conversion in your sender adapter:
<recordset_structure>.fieldSeparator = 'nl'
So in your receiver adapter you can replace any special char by 'nl' again.
Check these links.
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
http://help.sap.com/saphelp_nwpi711/helpdata/en/44/686e687f2a6d12e10000000a1553f6/content.htm
Regards,
Diego Estanguini Gabriel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.