a script of awk array – just mark
Just mark it. 🙂
#!/bin/sh
awk -F”_t_7_Y_” ‘{if($1==1) {printf $2; for(i=3;i<=NF;i++) if(i==NF) print $i;else printf $i}}’ temp1 > 1.txt
awk -F”_t_7_Y_” ‘{if($1==2) if($2 in S22){S22[$2]=$2;S23[$2]=$3″ “S23[$2];N2[$2]++}else {S22[$2]=$2;S23[$2]=$3;N2[$2]=
awk ‘NR==FNR {for(i=2;i<=NF;i++) S[$1]=S[$1]” “$i;}NR>FNR{print $0” “S[$1]}’ 2.txt 1.txt > t1.txt
awk ‘NR==FNR {for(i=2;i<=NF;i++) S[$1]=S[$1]” “$i;}NR>FNR{print $0” “S[$1]}’ 3.txt t1.txt > t2.txt
awk ‘NR==FNR {for(i=2;i<=NF;i++) S[$1]=S[$1]” “$i;}NR>FNR{print $0” “S[$1]}’ 4.txt t2.txt > final.txt
本文固定链接: https://www.2hei.net/2010/09/06/a_script_of_awk_array/ | 2hei.net
最活跃的读者