Created
October 14, 2019 21:46
-
-
Save jpomfret/0fd20467b56125e387c66e6cab8d4385 to your computer and use it in GitHub Desktop.
Read Excel Files in and Export CSVs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source for xlsx files | |
$SourceFolder = 'C:\Folder' | |
# Destination folder for where the csvs will go | |
$DestFolder = 'C:\Folder\csv' | |
# Foreach Excel file, read it in and then export to CSV with the same name. | |
Get-ChildItem $SourceFolder -Filter *.xlsx | | |
ForEach-Object { Import-Excel $_.FullName | Export-Csv -Path ("{0}\{1}.csv" -f $DestFolder, $_.basename) -NoTypeInformation } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment