我试图理解行代码。
这是什么意思?
grep "^1 " file0 | grep -v MODEL | sed 's/./&E/86' | sed 's/./& /8' | sed 's/./& /20' > file1
答案 0 :(得分:6)
# Add "E" after the 86th character
sed 's/./&E/86'
# Add " " after the 8th character
sed 's/./& /8'
# Add " " after the 20th character
sed 's/./& /20'
答案 1 :(得分:6)
您可以将所有内容合并为一个grep
表达式
sed
之前使用多个sed
管道
sed '/^1 /{/MODEL/b;s/./&E/86;s/./& /8;s/./& /20}' file0 > file1