cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mmorley
Resolver I
Resolver I

Line feeds not splitting correctly

Hi,

 

Further to my previous post regarding importing a text file that has been converted from a csv file, microsoft sees the end of lines as '\r\n' but it I try to split on this, the split fails.

 

If I create a variable that just has the enter key entered to get the carriage return, the split then only works on \n part and thus leaves \r in the line when it is returned

how can i get flow to see the \r\n as the end of line properly

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @v-alzhan-msft 

 

The other thread was https://powerusers.microsoft.com/t5/Building-Flows/Help-needed-for-reading-text-file-and-adding-each...

 

We have a excel csv file sent to us on regular basis, we need to import this into a sharepoint list, so the process i follow is

 

Get attachment from email if csv file

save csv file as txt file (flow just sees a stream otherwise and not the the actual text)

read txt file and process each line

add contents to list

 

after some trials I have got it working by using the following to split each line correctly to get rid of '\r\n

 

split(uricomponenttostring(replace(uricomponent(variables('CSVDATA')),'%0D%0A','*','*')

 

the solution provided my @DeepakS was perfect and the simplest method going to get the data into a list, just had to make the slight change to the split by adding the '%0D'

View solution in original post

3 REPLIES 3
v-alzhan-msft
Community Support
Community Support

Hi @mmorley ,

 

Could you share the link of the previous post?

Could you please explain more details about the csv file and the requirement so we could better understand your requirement and provide the proper workaround.

 

Best regards,

Alice   

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-alzhan-msft 

 

The other thread was https://powerusers.microsoft.com/t5/Building-Flows/Help-needed-for-reading-text-file-and-adding-each...

 

We have a excel csv file sent to us on regular basis, we need to import this into a sharepoint list, so the process i follow is

 

Get attachment from email if csv file

save csv file as txt file (flow just sees a stream otherwise and not the the actual text)

read txt file and process each line

add contents to list

 

after some trials I have got it working by using the following to split each line correctly to get rid of '\r\n

 

split(uricomponenttostring(replace(uricomponent(variables('CSVDATA')),'%0D%0A','*','*')

 

the solution provided my @DeepakS was perfect and the simplest method going to get the data into a list, just had to make the slight change to the split by adding the '%0D'

Hi @mmorley ,

 

So does your problem solved now?

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,071)