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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Extract PDF - how to d...
Power Automate
Answered

Extract PDF - how to deal with when what I extract sometime crosses a line break? This is using Power Automate DESKTOP

(0) ShareShare
ReportReport
Posted on by 49

Please see the attached image file that shows (3) versions of extracted text from a PDF using Power Automate desktop.

At this time I'm using a method on a about 25 pieces of content by using the parse and get subtext based on logic between the starting position of the "Before" text and the Starting Position of "After" text to then extract specific text. 


I want the highlighted content in each image - "date at time"

 

So using my aforementioned approach the "Before" text I look for is "SUBMITTED " and the AFTER text I look for is "REPORTED SOURCE " - then I use the GetSubtext for the exact amount of characters for the "date at time" - which is 22 characters.

 

The issue - is that sometimes the "date at time" content crosses over to another line and the number of characters to extract changes randomly - and - it's retrieving the Line Break?

 

So for each image the result of the GetSubtext is:

 

(1) 02/24/2023 at 02:10 PM

(2) 02/14/2023 at 02:47 P
M

(3) 02/15/2023 at
12:1

 

I’m using Power Automate DESKTOP

 

So I was thinking an approach may be to *Remove LINE BREAKS from the temporary TXT file and then the number of characters will NOT vary and I won't retrieve the line break.  (* - couldn't figure that out)

 

I'd appreciate any help!

Text Examples.jpg
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
  • mstjohnsomc Profile Picture
    49 on at

    @Anonymous - I appreciate your response, but I am using Power Automate DESKTOP!

  • Verified answer
    Pavel_NaNoi Profile Picture
    1,074 on at

    ***Edit

    Apologies, my last suggestion is wrong, I forgot PAD works differently in this scenario (I simply used regex101 at first), to actually have it do what you want, do the following:

    -Extract text from pdf

    -Use the "Split text" action and split by a new line to create a list

    -Use the "Join Text" action and join the list you've just created and join it via a single space.

    That should work.

  • mstjohnsomc Profile Picture
    49 on at

    @Pavel_NaNoi  I’ll be at the office in about two hours and I’ll give that a try. Appreciate your response, FYI the text I’m extracting comes from the extract from PDF step using Power Automate desktop.

  • Pavel_NaNoi Profile Picture
    1,074 on at

    no worries, yep that should be fine.

  • mstjohnsomc Profile Picture
    49 on at

    Got to office and I tried yoru first recommendation but that did NOT work, as you know and while I was driving and attempting you replied. Appreciate you following up!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 227

#2
David_MA Profile Picture

David_MA 204 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 177

Last 30 days Overall leaderboard