shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RES: [shell-script] sequencia de numeros


From: Gentil de Bortoli Júnior
Subject: Re: RES: [shell-script] sequencia de numeros
Date: Tue, 17 Jan 2006 15:44:18 -0200
User-agent: Thunderbird 1.5 (X11/20051201)

lferreir1 wrote:
preciso é justamente o número da linha que em está faltando a sequência

Luiz, mais uma tentativa, aproveitando a mesma idéia. Isso não vai te dar a linha exata onde o problema ocorreu, mas vai te dizer o perímetro da falha.

cat Teste.txt | cut -d " " -f 2 | paste -d ":" - - - | nl | awk '$2 != "00:01:99" {print "Linha: " $1*3-2" Registro: "$2}'

$ cat Teste.txt
1 00
2 01
260 99
261 00
262 01
268 99
269 00
270 01
273 99
274 00
275 01
294 99
294 99
294 99
269 00
270 01
270 01
270 01
1 00
2 01
260 99
1 00
2 01
260 99
260 99
260 99
260 99

$ cat Teste.txt | cut -d " " -f 2 | paste -d ":" - - - | nl | awk '$2 != "00:01:99" {print "Linha: " $1*3-2" Registro: "$2}'

Linha: 13   Registro: 99:99:00
Linha: 16   Registro: 01:01:01
Linha: 25   Registro: 99:99:99

Se você quiser uma explicação sobre o comando, avise.

[]s

Gentil.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]