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

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

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
Anonymous
Not applicable

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
Anonymous
Not applicable

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.