Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
ebjim
Helper IV
Helper IV

Check for existence of line feeds / carriage returns

Can Text.Contains be used to detect the existence of line feeds and carriage returns, e.g. TextContains([column1]."#(cr)#(lf)") ?

 

Thanks!

1 ACCEPTED SOLUTION
v-nikhilan-msft
Community Support
Community Support

Hi @ebjim 
Thanks for using Fabric Community.
You can use the below codes for acheiving the above requirement.

 

 Text.Contains([column1], String.Characters({10, 13}))

 

This approach uses Text.Contains to check if the column contains any of the character codes for carriage return and line feed. String.Characters({10,13})  creates a string containing the character codes for line feed (10) and carriage return (13).

 

Text.Matches([column1], "\r|\n")

 

You can also use the Text. Matches function with a regular expression that matches both carriage returns and line feeds. This expression will return a list of matches for either a carriage return (\r) or a line feed (\n) in the text column. If there are any matches, it means the text contains at least one line break.

Hope this helps. Please let us know if you have any further questions.

View solution in original post

1 REPLY 1
v-nikhilan-msft
Community Support
Community Support

Hi @ebjim 
Thanks for using Fabric Community.
You can use the below codes for acheiving the above requirement.

 

 Text.Contains([column1], String.Characters({10, 13}))

 

This approach uses Text.Contains to check if the column contains any of the character codes for carriage return and line feed. String.Characters({10,13})  creates a string containing the character codes for line feed (10) and carriage return (13).

 

Text.Matches([column1], "\r|\n")

 

You can also use the Text. Matches function with a regular expression that matches both carriage returns and line feeds. This expression will return a list of matches for either a carriage return (\r) or a line feed (\n) in the text column. If there are any matches, it means the text contains at least one line break.

Hope this helps. Please let us know if you have any further questions.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors