powershellconvertxlsxtocsvwithdelimiter

PowerShell: Convert Excel File to CSV with Special Delimiter

Summary: Or actually, save an excel file as CSV and then recreate it with a specific delimiter
Date: Around 2013
Refactor: 22 March 2025: Checked links and formatting.

cd "D:\filedir\"
$Excel = New-Object -ComObject Excel.Application
$Excel.visible = $false
$Excel.DisplayAlerts = $False
$file = "D:\filedir\excelfile.xlsx"
$csv = "D:\filedir\excelfile.csv"
$csvfinal = "D:\filedir\excelfilefinal.csv"
$workfile = $Excel.Workbooks.open($file)
$Sheet = $workfile.Worksheets.Item(1)
$Sheet.Activate()
$Sheet.SaveAs($csv,[Microsoft.Office.Interop.Excel.XlFileFormat]::xlCSVWindows)
$workfile.Close()
sleep 5
$Excel.Quit()
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($excel)
Import-Csv $csv | Export-Csv $csvfinal -Delimiter ";" -NoTypeInformation
powershellconvertxlsxtocsvwithdelimiter.txt · Last modified: by 127.0.0.1

Exception: Git command failed to perform periodic pull: From https://dev.azure.com/getshiftingcom/Documentation/_git/knowledge * branch main -> FETCH_HEAD fatal

Exception: Git command failed to perform periodic pull: From https://dev.azure.com/getshiftingcom/Documentation/_git/knowledge * branch main -> FETCH_HEAD fatal

An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the gitbacked plugin.

More info has been written to the DokuWiki error log.