所以,我的文件看起来像:
First,Middle,Last,Prefix,Address,Address2,City,State,Zip
JOSHUA,D,EVOLA,MR,553 KIRKPATRICK RD,"",ENNIS,TX,75119
NICHOLAS,,HUDSON,MR,24 DWIGHT ST,APT 38,AGAWAM,MA,01001
我想添加一个列(在第0列),它将是First + Middle + Last + 7766。
(注意:某些记录/行中的中间是空的。)
所以,我要找的结果是:
JOSHUADEVOLA7766,JOSHUA,D,EVOLA,MR,553 KIRKPATRICK RD,"",ENNIS,TX,75119
NICHOLASHUDSON7766,NICHOLAS,,HUDSON,MR,24 DWIGHT ST,APT 38,AGAWAM,MA,01001
我该怎么做?
答案 0 :(得分:1)
awk 'BEGIN{FS=OFS=","} {print $1 $2 $3 7766, $0}' file