9
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PowerShellでテキストファイルを結合する

9
Posted at

サブフォルダを含めてテキストファイルを結合したい場合の備忘録として...

Get-ChildItem でファイルを取得します(拡張子は大文字と小文字を区別しません!)

Get-ChildItem ".\Folder" -Recurse -File -Filter "*.txt" 

Get-Content でテキスト内容を取得します

Get-ChildItem ".\Folder" -Recurse -File -Filter "*.txt" | Get-Content

Add-Content で出力します

Get-ChildItem ".\Folder" -Recurse -File -Filter "*.txt" | Get-Content | Add-Content "out.txt"
9
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?