我尝试解析一些文本文件,最后我需要从 2 行中创建 1 行:
19.10.2012 15:33:22<TAB here!>
textline<TAB here!>#1
19.10.2012 15:33:13<TAB here!>
textline<TAB here!>#2
19.10.2012 15:29:29<TAB here!>
textline<TAB here!>#3
19.10.2012 15:29:23<TAB here!>
textline<TAB here!>#4
在输出我需要有这个:
19.10.2012 15:33:22<TAB here!>textline<TAB here!>#1
19.10.2012 15:33:13<TAB here!>textline<TAB here!>#2
19.10.2012 15:29:29<TAB here!>textline<TAB here!>#3
19.10.2012 15:29:23<TAB here!>textline<TAB here!>#4
请帮帮我!:)
编辑:这就是我所拥有的:
Get-ChildItem $Path -Recurse -Include *.* | Foreach-Object {$_.FullName} |
Foreach-Object {
Write-Host $_
$Item = Get-Item $_
(Get-Content $_ -ReadCount 2 -Encoding UTF8) | Foreach-Object {
(-join $_)}} | Set-Content $Item -Encoding UTF8