-
[PowerShell 예제] 파일을 줄 단위로 나눠 저장하는 스크립트 예시Shell & CMD/PowerShell 2022. 8. 6. 18:01반응형
파일을 10만줄 단위로 나눠 출력하는 파워셸 스크립트 예시이다.
Get-Content error.csv -ReadCount 100000 | %{$i++; $_ | Out-File err_$i.csv}
출처 :
How can I split a text file using PowerShell? - Stack Overflow
How can I split a text file using PowerShell?
I need to split a large (500 MB) text file (a log4net exception file) into manageable chunks like 100 5 MB files would be fine. I would think this should be a walk in the park for PowerS...
stackoverflow.com
반응형'Shell & CMD > PowerShell' 카테고리의 다른 글
[PowerShell 예제] ps1 에서 다른 ps1 파일 참조하기 (0) 2022.12.20 [PowerShell Tips] .ps1 또는 함수실행시 정해진 파라메터만 받을 수 있도록 처리하는 ValidateSet 속성 (0) 2022.12.19 [PowerShell 예제] Start-ThreadJob을 이용한 동시 처리 스크립트 구현 (0) 2022.07.30 [PowerShell] 파워셸에서 한글 파일명 깨지지 않게 압축 풀기 (0) 2022.07.30 [Powershell 예제] foreach, Where를 사용하여 파일 일괄 인코딩 변경 (0) 2022.07.13