|
From: | Fredi Rolf Bieging |
Subject: | Re: [shell-script] Contar espaço em um arquivo. |
Date: | Tue, 8 Sep 2015 12:58:46 -0300 |
Testando o campo $3 como vazio
awk -F";" '$3 ~ /^$/ {i++; print}; END {print i}'
<<<'"123";"teste";"cachorro"
"124";"teste"
"125";"teste";"cachorro"
"126";"teste"
"127";"teste"
"128";"teste";"cachorro"'
"124";"teste"
"126";"teste"
"127";"teste"
3
On 07-09-2015 18:38, address@hidden [shell-script] wrote:
> Caros Boa Noite,
>
> Tenho um arquivo com seguinte formato:
>
> cat texto.txt
>
> "123";"teste";"cachorro"
> "124";"teste"
> "125";"teste";"cachorro"
> "126";"teste"
> "127";"teste"
> "128";"teste";"cachorro"
>
>
> Estou tentando pegar apenas as linhas da terceira coluna vazia. Então
> pensei em printar a terceira coluna e aplicar a contagem porem não estou
> conseguindo resolver aparti disso. Abaixo segue minha tentativa:
>
>
> cat texto.txt | awk -F ";" '/^ $/{print $3}' | wc -l
>
>
> ele me retorna 0
>
>
> Queria que alem de contar me trouxesse a linha por completo. Por exemplo:
>
>
> 3 linhas vazias
>
>
> "124";"teste"
>
> "126";"teste"
> "127";"teste"
>
>
> Podem me ajudar?
>
>
> Att,
>
>
>
> ----------------------------------------------------------
> Enviado por: address@hidden
> ----------------------------------------------------------
[Prev in Thread] Current Thread [Next in Thread]
- Contar espaço em um arquivo., ezieljuniorjr, 2015/09/08
- Re: [shell-script] Contar espaço em um arquivo., Julio C. Neves, 2015/09/08
- Re: [shell-script] Contar espaço em um arquivo., Rodrigo Tenorio, 2015/09/08
- Re: [shell-script] Contar espaço em um arquivo., hpfn, 2015/09/08
- Re: [shell-script] Contar espaço em um arquivo., Ultimo de Miranda, 2015/09/08
- Re: [shell-script] Contar espaço em um arquivo., itamarnet, 2015/09/08
- Re: [shell-script] Contar espaço em um arquivo., phfbettega, 2015/09/08
- Re: [shell-script] Contar espaço em um arquivo., Fredi Rolf Bieging <=
- Re: [shell-script] Contar espaço em um arquivo., hpfn, 2015/09/08
- Re: Contar espaço em um arquivo., ezieljuniorjr, 2015/09/08
- Re: [shell-script] Re: Contar espaço em um arquivo., Fernando Mercês, 2015/09/10
- Prev by Date: Re: [shell-script] Contar espaço em um arquivo.
- Next by Date: Re: [shell-script] Contar espaço em um arquivo.
- Previous by thread: Re: [shell-script] Contar espaço em um arquivo.
- Next by thread: Re: [shell-script] Contar espaço em um arquivo.
- Index(es):