1
Excel 파일의 여러 시트를 CSV 파일로 내보낼 때 발견 한 코드에서 일부 코드가 업데이트되었습니다. 첫 6 행없이 내보내기해야합니다. 모두 같은 형식입니다.CSV 오프셋 행으로 PowerShell 내보내기
어디에서 각 탭에 오프셋을 적용 할 수 있습니까?
function ExportWSToCSV {
Param(
[Parameter(Position=0, Mandatory=$true)] [string]$excelPath,
[Parameter(Position=1, Mandatory=$true)] [string]$excelFileName,
[Parameter(Position=2, Mandatory=$true)] [string]$excelFormat,
[Parameter(Position=3, Mandatory=$true)] [string]$csvPath
)
Write-Output "Your cvs files are located " $csvPath
$excelFile= $excelPath + $excelFileName + $excelFormat
$E = New-Object -ComObject Excel.Application
$E.Visible = $false
$E.DisplayAlerts = $false
$wb = $E.Workbooks.Open($excelFile)
foreach ($ws in $wb.Worksheets) {
$n = $excelFileName + "_" + $ws.Name
$ws.SaveAs($csvPath + $n + ".csv", 6)
}
$E.Quit()
}
다음 통합 문서를 닫기 전에 변경 사항을 취소, 내보내기 전에 각 시트의 첫 번째 6 개 행을 삭제합니다. –
나에게이 예를 들어 주시겠습니까? 모든 동일한 코드에서 실행하고 싶습니다. 빠른 응답 주셔서 감사합니다 – user2181700