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.
我有一个文件。我想替换单词:如果存在“a”,则将“a”替换为“p”,否则将“a”替换为“q”。并保存该文件。如何使用批处理脚本来做到这一点?
我对 Windows的建议:
sed "y/a/p/" file.txt > newfile.txt