Skip to Content
Author's profile photo Former Member

Remove line feed (or) CRLF from text fields

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 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.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.