Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想转换每次出现的"\\192.168.0.2\"with"q:\"
"\\192.168.0.2\"
"q:\"
到目前为止,我想出了:
perl -i.bak -pe 's/\\\\192.168.0.2\\/q:\\/' report.txt
这不会更改文件中的任何内容。我可以使用一些指导!谢谢
示例:处理的文件类型 2012 年 10 月 29 日上午 9:08:58 \\192.168.0.2\reports\report.xls
perl -i.bak -pe "s/\\\\192\.168\.0\.2\\/q:\\/" report.txt
注意双引号