擅长:python、mysql、java
<p>如果您使用Python3,以下模块将帮助您:
<a href="https://github.com/mahmoudadel2/pysed" rel="noreferrer">https://github.com/mahmoudadel2/pysed</a></p>
<pre><code>wget https://raw.githubusercontent.com/mahmoudadel2/pysed/master/pysed.py
</code></pre>
<p>将模块文件放入Python3模块路径,然后:</p>
<pre><code>import pysed
pysed.replace(<Old string>, <Replacement String>, <Text File>)
pysed.rmlinematch(<Unwanted string>, <Text File>)
pysed.rmlinenumber(<Unwanted Line Number>, <Text File>)
</code></pre>