YanoRyuichi.com/
Wiki
Blog
GitHub
Sandbox
開始行:
* ConvertTo-Csv [#aa60abff]
*** TYPEの削除 -NoTypeInformationオプション[#m7eb79a6]
PS> dir *.txt | select FullName, FileSize, LastWriteTime...
#TYPE Selected.System.IO.FileInfo <= *** この行...
"FullName","FileSize","LastWriteTime"
"C:\tmp\1.txt"," 786 B ","2018/05/15 3:40:31"
"C:\tmp\2.txt"," 786 B ","2018/05/15 3:40:24"
↓
PS> dir *.txt | select FullName, FileSize, LastWriteTime...
"FullName","FileSize","LastWriteTime"
"C:\tmp\1.txt"," 786 B ","2018/05/15 3:40:31"
"C:\tmp\2.txt"," 786 B ","2018/05/15 3:40:24"
*** デリミタの指定 -Delimiter [#uae67c4f]
dir * | select FullName, FileSize, LastWriteTime | Conve...
ここではタブ区切りを指定。
*** 最初の行のヘッダーなど、邪魔な行があるのを消す select...
PS> dir *.txt | select FullName, FileSize, LastWriteTime...
"FullName","FileSize","LastWriteTime" <= ...
"C:\tmp\1.txt"," 786 B ","2018/05/15 3:40:31"
"C:\tmp\2.txt"," 786 B ","2018/05/15 3:40:24"
↓
PS> dir *.txt | select FullName, FileSize, LastWriteTime...
"C:\tmp\1.txt"," 786 B ","2018/05/15 3:40:31"
"C:\tmp\2.txt"," 786 B ","2018/05/15 3:40:24"
** 参考 [#v9e486f8]
https://msdn.microsoft.com/en-us/powershell/reference/5.1...
終了行:
* ConvertTo-Csv [#aa60abff]
*** TYPEの削除 -NoTypeInformationオプション[#m7eb79a6]
PS> dir *.txt | select FullName, FileSize, LastWriteTime...
#TYPE Selected.System.IO.FileInfo <= *** この行...
"FullName","FileSize","LastWriteTime"
"C:\tmp\1.txt"," 786 B ","2018/05/15 3:40:31"
"C:\tmp\2.txt"," 786 B ","2018/05/15 3:40:24"
↓
PS> dir *.txt | select FullName, FileSize, LastWriteTime...
"FullName","FileSize","LastWriteTime"
"C:\tmp\1.txt"," 786 B ","2018/05/15 3:40:31"
"C:\tmp\2.txt"," 786 B ","2018/05/15 3:40:24"
*** デリミタの指定 -Delimiter [#uae67c4f]
dir * | select FullName, FileSize, LastWriteTime | Conve...
ここではタブ区切りを指定。
*** 最初の行のヘッダーなど、邪魔な行があるのを消す select...
PS> dir *.txt | select FullName, FileSize, LastWriteTime...
"FullName","FileSize","LastWriteTime" <= ...
"C:\tmp\1.txt"," 786 B ","2018/05/15 3:40:31"
"C:\tmp\2.txt"," 786 B ","2018/05/15 3:40:24"
↓
PS> dir *.txt | select FullName, FileSize, LastWriteTime...
"C:\tmp\1.txt"," 786 B ","2018/05/15 3:40:31"
"C:\tmp\2.txt"," 786 B ","2018/05/15 3:40:24"
** 参考 [#v9e486f8]
https://msdn.microsoft.com/en-us/powershell/reference/5.1...
ページ名: