2
A
回答
4
(get-content file.txt) -replace '\.',"`n" | out-file newfile.txt
-replace操作符使用正則表達式匹配,因此您需要轉義點以使其匹配字面點。否則,它會替換該文件中的每個字符。
2
足夠簡單:
Get-Content C:\Imagine_Lyrics.txt | % {$_.Replace('.', "`n")} | Out-File C:\Imagine_Lyrics2.txt -Encoding ASCII
+0
我想你忘了關支架。 – expirat001 2012-02-11 16:04:55
+0
Whoopsy,謝謝@ expirat001 :-) – 2012-02-11 16:06:22
它的工作原理,謝謝。 – expirat001 2012-02-11 16:05:22