|
From: | Julio C. Neves |
Subject: | Re: [shell-script] Como pegar só os campos necessários? |
Date: | Tue, 1 Apr 2014 21:34:05 -0300 |
Próximos cursos de Shell |
||
Cidade |
Local |
Período |
Rio de Janeiro |
07-11/04 |
Boa tarde Julio,Testei a sua solução, porem não funcionou muito bem. Veja só o erro q renornou:Pid 18778 received a SIGSEGV for stack growth failure.Possible causes: insufficient memory or swap space,or stack size exceeded maxrsessizor stack size limit is set too small.A qtd total i bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1, bundling space exceeded on line 1,paste: 2 : Cannot open the file. 1,@itamarnet@yahoo.com.brDaria pra adicionar algum filtro para o campo nome? Um grep pra pegar somente o B089 por exemplo?Pois dentro de um mesmo arquivo tenho vários nomes diferentes. Ex: B01, B08, B22, etcawk '
BEGIN {FS=";"Total = 0}{print $1, $2, $4Total += $2}END { print Total }' TPD_2014_03_*.oldConteúdo do arq:
B089;6;GP97;20140321nome qtd tipo dataEm 29 de março de 2014 18:37, Julio C. Neves <address@hidden> escreveu:
Anderson,acabei de pensar numa saída incrível para esse problema. Deve ser lenta, mas é bem inusitada. Veja:Qtd=$(cut -f2 -d\; TPD_2014_03_27.old)echo A qtd total é $(tr ' ' + <<< $Qtd | bc)paste <(cut -f1 -d\; TPD_2014_03_27.old) $Qtd <(cut -f4 -d\; TPD_2014_03_27.old)As colunas estarão separadas por <TAB>. Se vc quiser outro delimitador, p. ex. dois pontos, use a opção -d: no pasteExperimente aí e diga se funcionou e se vc entendeuAbcs,Julio@juliobash
Próximos cursos de Shell
Cidade
Local
Período
Rio de Janeiro
07-11/04
Dou treinamento de shell em qualquer cidade.
Para detalhes, entre em contato por email ouecho 436233889341364416673541503686485725801923229706P | dcEm 29 de março de 2014 11:25, Renan Fuentes <address@hidden> escreveu:Bom dia,Em 28 de março de 2014 17:50, Anderson <address@hidden> escreveu:
Prezados, boa tarde.Tenho vários arquivos (gerados diariamente) no seguinte formato:DataEx do nome do arquivo TPD_2014_03_27.oldConteúdo do arq:B089;6;GP97;20140321nome qtd tipo dataGostaria de saber como eu faço pra calcular a qtd total do mês? E pegar as informações nome + qtd + data?awk -F";" '{print substr($4,5,2)}' teste.txt | sort | uniq -cVlwAbraços--______________________________________
Renan Catalani Fuentes de Campos
[Prev in Thread] Current Thread [Next in Thread]
- Re: [shell-script] Como pegar só os campos necessários?, Anderson, 2014/04/01
- Re: [shell-script] Como pegar só os campos necessários?, Julio C. Neves <=
- Re: [shell-script] Como pegar só os campos necessá rios?, itamarnet, 2014/04/02
- Re: [shell-script] Como pegar só os campos necessá rios?, Anderson, 2014/04/04
- Prev by Date: Re: [shell-script] Como pegar só os campos necessários?
- Next by Date: Re: [shell-script] Como pegar só os campos necessá rios?
- Previous by thread: Re: [shell-script] Como pegar só os campos necessários?
- Next by thread: Re: [shell-script] Como pegar só os campos necessá rios?
- Index(es):