Remove EOL
Description
Removes EOL (end of line/newline) characters from any part of the text.
Category
Transformation
Supported Field Types
- text
Output Field Type
- text
Arguments
None
Pseudo-code (Python)
def func(val):
"""
val: value of the text field
"""
import re
if val:
return re.sub(r'[\n\r]+', '', val)
else:
return None
Remove EOL characters from text fields
Apply the Remove EOL transformation in Kondado to strip newline and carriage-return characters from text data before loading it to your destination.
Identify text fields with line-break issues
Locate text fields in your source data that contain unwanted newline (\n) or carriage-return (\r) characters that may break CSV exports, spreadsheet imports, or string matching downstream.
Open the pipeline transformations
In the Kondado platform, open the pipeline that handles the affected field and go to the transformations step.
Apply the Remove EOL function
Add the Remove EOL function to the target text field. No arguments are required: it strips all line breaks via the regex [\n\r]+ and returns None when the input is null or empty.
Validate the cleaned output
Run a test execution and confirm the output is still text type but free of newline characters, so it loads cleanly into your destination.
Save and replicate to destination
Save the pipeline so the transformation runs automatically on every replication, keeping the data clean at the frequency you choose.
Frequently asked questions
[\n\r]+.None (null) rather than attempting to process it, preventing errors in your pipeline execution.