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

Fabric Data Days Monthly is back. Join us on March 26th for two expert-led sessions on 1) Getting Started with Fabric IQ and 2) Mapping & Spacial Analytics in Fabric. Register now

Reply
ebjim
Resolver I
Resolver I

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

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Fabric Update Carousel

Fabric Monthly Update - February 2026

Check out the February 2026 Fabric update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors