Powershell
--
Questions
--
Followers
Top Experts
How can I convert and xlsx spreadsheet into CSV ?
Thanks,
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
http://podlisk.wordpress.com/2011/11/20/import-excel-spreadsheet-into-powershell/






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
# Excel file to convert
$xls = "C:\file1.xls";
# csv file to create
$csv = "C:\file1.csv";
Â
Get-Content -Path $xls | Export-CSV -Path $csv -NoTypeInformation;
I have the following code and it pops up a window to Save As
$ExcelWB = new-object -comobject excel.application
$Workbook = $ExcelWB.Workbooks.Open("C:\scripts\AD\temp\10-22-2012.xlsx") 
$Workbook.SaveAs("C:\scripts\AD\temp\10-22-2012_Test.csv",6)
$ExcelWB.quit()
$File = "C:\user1.xlsx"
$savePath = "C:\Result.csv"
$objExcel = New-Object -ComObject Excel.Application
$objworkbook=$objExcel.Workbooks.Open($File)
$objworkbook.SaveAs($savePath,6)
$objworkbook.Close($false)
$objExcel.Quit()
Import-Csv -Path $savePath

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Last Name               : Gilles
First Name              : Elisabeth
Dept Descrip            : 1.A6300 - AR Resolution
Social Security Numbers : XXXXXXXXX
Employment Category     : F
Job Title               : AcctsReceivableSpecialist
Work Phone              : 303303456
Room                    :
Clock Number            : 2780
Date Of Birth           : 9/9/1980
Div Descrip             : Administration
Powershell
--
Questions
--
Followers
Top Experts
Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to the Component Object Model (COM) and Windows Management Instrumentation (WMI), enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and Common Information Model (CIM) enabling management of remote Linux systems and network devices.