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 / Remove junk characters
Power Automate
Answered

Remove junk characters

(0) ShareShare
ReportReport
Posted on by 54

Hey all,

 

I'm trying to copy text from one word doc to another. 

I use the ReadFromWordDocument action then crop the text I want to extract.

Problem is I seem to be getting some junk characters along with the actual text. Which are displayed as rectangles.

tc839_0-1718711487154.png

Here is the source doc

tc839_1-1718711571743.png

Does anyone know what the rectangles are, and if there's an easy way to remove them. (Due to organisations policies I can't use any scripts apart from powershell)

 

I have the same question (0)
  • VishnuReddy1997 Profile Picture
    2,656 Super User 2026 Season 1 on at

    Hi @tc839 ,

     

    You can try 2 methods.

     

    1. Using PAD actions.

    • Add the Replace Text action to your flow.
    • In the Text field, input the variable that holds your text (the output of your ReadFromWordDocument action).
    • In the Find what field, input the regular expression that matches the characters you want to remove. For non-printable characters, you can try "[^\x20-\x7E]" which represents all characters outside the printable ASCII range.
    • Leave the Replace with field empty to remove the matched characters.
    • The Replace Text action will output a new text variable which should be free of the unwanted characters.

    2. Powershell Script Method

    • In PowerShell, you can use the -replace operator to remove these characters. Here’s a simple example:

      $text = ReadFromWordDocument -Path "path_to_your_document"
      $cleanText = $text -replace "[^\x00-\x7F]", ""

    (Note:- if you got your solution you can mark as solution and gives kudos)


    Thanks & Regards

    Vishnu Reddy

  • tc839 Profile Picture
    54 on at

    Thanks but that didn't seem to work.

    Also you can't leave the Replace with field empty, it throws an error. Unless I'm missing something....

  • Verified answer
    Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @tc839 

     

    Try like below screenshot:

    Deenuji_0-1720458490645.png

     

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • Verified answer
    tc839 Profile Picture
    54 on at

    Thanks that's working now


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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard