web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Remove line breaks in ...
Power Automate
Unanswered

Remove line breaks in String only when they are between speech marks

(1) ShareShare
ReportReport
Posted on by 118
Hi all

I have a csv which is being exported as an email attachment, I am then using Power Automate to get the attachment content to Base64 then convert it to a String.  I am using this data to add a row to a table in excel by splitting on line breaks in order to create an array by using the function
split(outputs('Remove_line_breaks_within_content'),decodeUriComponent('%0D%0A'))
The problem I am having is that some of the data might have line breaks in them.  I need a way to remove/replace line breaks if they are within a set of speech marks.  I have tried using regex but haven't got anywhere.
replace(outputs('Base64_To_String'),'(\".*?)\r\n(.*?\")', '$1$3')
 
Data example:
"Infocard","Number","Title","Vault"
"CPR","12","Example Data
","TAG"
"CRQ","12","Example Data without line break","TAG"
 
Is there another way I can do this which will ensure that line breaks that occur within the Title field are removed but they remain at the end of each row?
 
Thanks
Grant
Categories:
I have the same question (0)
  • Verified answer
    abm abm Profile Picture
    32,865 Most Valuable Professional on at
    Try the  below
     
     
     
    Expressions are:
     
    replace(outputs('Compose'), decodeUriComponent('%0A'), ' ')
     
    This will remove all the new lines
     
    split(outputs('Compose_2'),'" "')
     
    The above split is used for splitting each line using '" "'
     
    Here is my test result
     
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard