sed命令去掉源代码行号的方法
sed命令去掉源代码行号的方法,供大家学习参考。
cat old.txt | sed -e 's/^[0-9]\{1,\}//g' >new.txt
或
cat old.txt | sed -e 's/^[^0-9a-zA-Z]*[0-9]\{1,\}//g' old.txt>new.txt
去空行
sed '/^$/d' filename
去空行首空格
sed 's/^[ ]//g' filename
您可能感兴趣的文章:
sed命令去掉源代码行号的方法
sed单行命令大全 值得收藏
shell去除空格/删除空格/清除空格/去掉空格的方法
sed命令例解
shell 去掉每行结尾的空格,附sed知识
shell实现对文件内容高效插入列的方法
shell统计日志中时间段内匹配的数量的方法
去除文件内容中的注释与空行的命令
PHP扩展报错[error: ‘PHP_FE_END’ undeclared here (not in a function)]
sed清除注释的脚本一例