Eu tenho menos de quatro linhas:
EXTRACT ETEST Last Started 2016-03-20 20:56 Status RUNNING
Checkpoint Lag 00:00:02 (updated 00:00:04 ago)
EXTRACT PTEST Initialized 2016-03-31 06:25 Status STOPPED
Checkpoint Lag 00:00:00 (updated 02:21:09 ago)
Tudo que eu quero fazer em duas linhas, como abaixo:
EXTRACT ETEST Last Started 2016-03-20 20:56 Status RUNNING Checkpoint Lag 00:00:02 (updated 00:00:04 ago)
EXTRACT PTEST Initialized 2016-03-31 06:25 Status STOPPED Checkpoint Lag 00:00:00 (updated 02:21:09 ago)
Que eu posso fazer com cat /tmp/glog.lst|xargs -n 14
:
EXTRACT ETEST Last Started 2016-03-20 20:56 Status RUNNING Checkpoint Lag 00:00:02 (updated 00:00:04 ago)
EXTRACT PTEST Initialized 2016-03-31 06:25 Status STOPPED Checkpoint Lag 00:00:00 (updated 02:21:09 ago)
Mas row1 tem 14 campos, row2 tem 13 campos.
O problema foi row2 foi inicializado versus "Último início"
Eu quero fazer uma linha com menos de 14 colunas para 14 cols instalando colunas fictícias com ou "N" (ou) alguma coisa, então ele terá 14 cols para que eu possa processar meu script facilmente.
Eu quero fazer isso finalmente
EXTRACT ETEST Last Started 2016-03-20 20:56 Status RUNNING Checkpoint Lag 00:00:02 (updated 00:00:04 ago)
EXTRACT PTEST Initialized N 2016-03-31 06:25 Status STOPPED Checkpoint Lag 00:00:00 (updated 02:21:09 ago)
Isso é o que eu preciso
$ awk '{ if (FNR%2==1) tmp=$0; else print tmp,$0 }' /tmp/gglog.lst
EXTRACT ETEST1 Initialized 2016-03-20 20:56 Status STOPPED Checkpoint Lag 00:00:02 (updated 00:00:09 ago)
EXTRACT ETEST2 Last Started 2016-03-20 20:56 Status RUNNING Checkpoint Lag 00:00:02 (updated 00:00:04 ago)
EXTRACT ETEST3 Last Started 2016-03-20 20:56 Status RUNNING Checkpoint Lag 00:00:02 (updated 00:00:09 ago)
EXTRACT PTEST1 Last Started 2016-03-29 08:46 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:02 ago)
EXTRACT PTEST0 Last Started 2016-03-29 08:46 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:05 ago)
Agora quero retirar os valores de coluna de Inicializado / Último / Iniciado para que ele apareça dessa maneira
EXTRACT ETEST1 2016-03-20 20:56 Status STOPPED Checkpoint Lag 00:00:02 (updated 00:00:09 ago)
EXTRACT ETEST2 2016-03-20 20:56 Status RUNNING Checkpoint Lag 00:00:02 (updated 00:00:04 ago)
EXTRACT ETEST3 2016-03-20 20:56 Status RUNNING Checkpoint Lag 00:00:02 (updated 00:00:09 ago)
EXTRACT PTEST1 2016-03-29 08:46 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:02 ago)
EXTRACT PTEST0 2016-03-29 08:46 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:05 ago)
ou podemos quebrar inicializado para iniciar agora ou seja. que nunca a linha nós arquivamos o trabalho Inicializado nós queremos quebrá-lo em "Init Now"
EXTRACT ETEST1 Init Now 2016-03-20 20:56 Status STOPPED Checkpoint Lag 00:00:02 (updated 00:00:09 ago)
EXTRACT ETEST2 Last Started 2016-03-20 20:56 Status RUNNING Checkpoint Lag 00:00:02 (updated 00:00:04 ago)
EXTRACT ETEST3 Last Started 2016-03-20 20:56 Status RUNNING Checkpoint Lag 00:00:02 (updated 00:00:09 ago)
EXTRACT PTEST1 Last Started 2016-03-29 08:46 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:02 ago)
EXTRACT PTEST0 Last Started 2016-03-29 08:46 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:05 ago)