Quantcast
Channel: SCN : Blog List - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 676

Remove line feed (or) CRLF from text fields

$
0
0

Issue Statement: Remove line feed/CRLF from text fields.

 

Issue:If the input text field has line feed/CRLF, then data gets shifted to subsequent fields in mapping, hence creating wrong target data.

 

Logic: Remove line feed/CRLF from the text

 

Solution: Create a simple UDF to remove line feed/CRLF

 

UDF Signature:

 

UDF_Signature.png

 

UDF Code:

String Input_Text1 = null;

String Input_Text2 = null;

Input_Text1 = Input_Text.replaceAll("\\n", "");

Input_Text2 = Input_Text1.replaceAll("\\r", "");

return Input_Text2;

 

Note: I am not a great Java coder . You can use a single String field instead of using two String fields, as I did.


Viewing all articles
Browse latest Browse all 676

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>