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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Neil_brown
New Member

Scraping data from PDF and save it

Hi All,

Very new to power Query and im hoping there is a solution to help me.

 

I have setup a quyery to import data from various PDF reports in various folders.  A new PDF is regularly added and i would like power query to add this data, once a day or so.  The issue is that the query takes an absolute age to run for the shear volume to pdf docs and the amount of query steps to remove the data and transform it.

 

  1. Is there a way to save the data and only work on new files
  2. Maybe archive the file once processed or change the name so it can be identified

Any ideas would be appreciated.  An oportunity to learn!

1 ACCEPTED SOLUTION
ahadkarimi
Solution Specialist
Solution Specialist

Hi @Neil_brown, give this a try, and if you encounter any issues, let me know.

Open PowerShell and run the command, making sure to change the source and destination to your own paths.

 

$sourceFolder = "C:\PDFs"
$archiveFolder = "C:\Archive"

$files = Get-ChildItem -Path $sourceFolder -Filter *.pdf

foreach ($file in $files) {
    $destination = Join-Path -Path $archiveFolder -ChildPath $file.Name
    Move-Item -Path $file.FullName -Destination $destination
}

 

 

Did I answer your question?  If so, please mark my post as the solution!
Your Kudos are much appreciated!  Proud to be a Resolver IV !

View solution in original post

3 REPLIES 3
Neil_brown
New Member

Hi @ahadkarimi,

 

Thanks for the reply and appologies for not getting back to you earlier.  I guess this solution takes the files from the specific folder and moves them to an archive location.  Is there a way to automate this as part of the Power Bi scraping of data.

 

Regards

Anonymous
Not applicable

Hi @Neil_brown 

Did the solution @ahadkarimi  offered help you solve the problem, if it helps, please consider to accept it as a solution so that more user can refet to, or you can provide more information so that can help you solve the problem.

 

Best Regards!

Yolo Zhu

ahadkarimi
Solution Specialist
Solution Specialist

Hi @Neil_brown, give this a try, and if you encounter any issues, let me know.

Open PowerShell and run the command, making sure to change the source and destination to your own paths.

 

$sourceFolder = "C:\PDFs"
$archiveFolder = "C:\Archive"

$files = Get-ChildItem -Path $sourceFolder -Filter *.pdf

foreach ($file in $files) {
    $destination = Join-Path -Path $archiveFolder -ChildPath $file.Name
    Move-Item -Path $file.FullName -Destination $destination
}

 

 

Did I answer your question?  If so, please mark my post as the solution!
Your Kudos are much appreciated!  Proud to be a Resolver IV !

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.