我是脚本新手.我试图解决一个问题,我正在看windows批处理和PowerShell.我找到了这个,但我不知道,为什么它不起作用:
我有input.txt文件包含这个内容:
<a> TEXT </a>
<c> text asdrtlj </c>
<a> another text </a>
Run Code Online (Sandbox Code Playgroud)
我想在每个之前添加新行<a>,所以我尝试了这个:
powershell -Command "(gc input.txt) -replace '<a>', '`r`n<a>' | Out-File output.txt"
Run Code Online (Sandbox Code Playgroud)
添加换行符不起作用.你能帮我吗?
PS:我在搜索解决方案时发现了很多复杂的代码,我还没有理解它们,所以如果你推荐我一些很好的教程,从这些语言开始,我会很感激.