|
发表于 2010-4-5 18:22:32
|
显示全部楼层
1)
awk1:
BEGIN{FS="[ $]"}
/entry/{min=$5;length=$6-$5+1;print $0}
~/entry/{print substr($0,$min,length)}
nawk -f awk1 file1> file1cliped
2)
paste file1 file2 >file3
awk2:
BGEIN{FS="[ $]"}
/entry/{min=$5;length=$6-$5+1;print $1}
~/entry/{for(i=3;i<=NF-2;i++)print substr($1,$i,1)}
nawk -f awk2 file3>file4
nawk -f awk1 file4>file2cliped |
|