Awk是一个面向记录的linux实用程序,对于基于文本文件的处理,是一个绝对的利器。
awk '{for(i=1;i<=NF;i++) if(i!=1) printf $i OFS; print""}' main.c
printf will not append a new line after print the string.
awk -F'/' '{printf $2 "/" $3 "\n" }' CONFIG_REC_DATA > ~/record_file
Wiki comments powered by Disqus