【发布时间】:2016-08-10 04:55:19
【问题描述】:
我有一个文件,我必须多次迭代,每次都用 python 运行它。如何从 shell 的特定行中删除或添加字符?
例如文件 ex.file,
$ cat ex.file
stuff
more stuff
more stuff
more stuff
#<- remove this character
<-add a pund sign here
more stuff
more stuff
我想要的输出是:
$ cat ex.file
stuff
more stuff
more stuff
more stuff
<- remove this character
#<-add a pund sign here
more stuff
more stuff
【问题讨论】: