Skip to content

Instantly share code, notes, and snippets.

View lyoungstratus's full-sized avatar

lyoungstratus

View GitHub Profile
@lyoungstratus
lyoungstratus / gist:ad4cfdf442517e1769144ee7fc6709d0
Created January 6, 2020 11:05
Using PDFtoText and Powershell to extract transactions from an Applecard Statement on MacOS
To extract transactions from an Apple card PDF statement to a tab delimited text under Powershell, you can use these commands:
pdftotext -table '.\Apple Card Statement - October 2019.pdf'
$regex = '^(\d\d)/(\d\d)/(20\d\d)\s+(.*?)\s+\S*%\s+\$\S+\s*(.*)'
get-content '.\Apple Card Statement - October 2019.txt' | where-object {
($_ -replace "\s+"," ") -match $regex
} | foreach-object {