Eu tenho um arquivo de script awk chamado tmp.awk
com o seguinte conteúdo
BEGIN {
i=0
}
{
if (i==0) {
f1=$0
i++
} else if (i==1) {
f2=$0
i++
} else {
i=0
print f1","f2","$0
}
}
E um arquivo origin.txt
com o seguinte conteúdo
cxx-yyy-zzz-999-111
2018-01-1T00:10:54.412Z
2018-01-5T00:01:19.447Z
1111-6b54-eeee-rrrr-tttt
2018-01-1T00:41:38.867Z
2018-01-5T01:14:55.744Z
1234456-1233-6666-mmmm-12123
2018-01-1T00:12:37.152Z
2018-01-5T00:12:44.307Z
Aqui está o meu comando awk e exemplo de saída.
zb@server ~ $ awk -f tmp.awk origin.txt
cxx-yyy-zzz-999-111,2018-01-1T00:10:54.412Z,2018-01-5T00:01:19.447Z
1111-6b54-eeee-rrrr-tttt,2018-01-1T00:41:38.867Z,2018-01-5T01:14:55.744Z
1234456-1233-6666-mmmm-12123,2018-01-1T00:12:37.152Z,2018-01-5T00:12:44.307Z