寻找语法以在文件中查找模式并仅从该模式中删除前导字符。
例如,find -16删除#并将其保存到文件中。
尝试过grep 12345-16 testfile2 | sed -e "s/^#//g"哪个有效,但需要将所有条目捕获到输入文件中。
例子:
由此:
something here 12345-14
something here 12345-15
# something here 12345-16
Run Code Online (Sandbox Code Playgroud)
对此:
something here 12345-14
something here 12345-15
something here 12345-16
Run Code Online (Sandbox Code Playgroud)
如有建议,我们将不胜感激。
sed ×1