|
From: | Julio C. Neves |
Subject: | Re: [shell-script] Contar registros posicionais |
Date: | Thu, 14 Jul 2016 01:02:37 -0300 |
mais uma duvida....queria incrementar esse comando para ele listar a unicidade com quantidade com mais de um campo....vejam só:
00000*HEADER
026531200621068000000010000000201605319353219GSIN
026544400621066000000020000000201605319353220GSIN
030544400621066000000020000000201605319353221RESD
028544400621066000000020000000201605319353222GSIN
026544400621066000000020000000201605319353223GSIN
99999*TRAILLER
Preciso como resposta um novo arquivo, com tp_movimento;origem;quantidade
026;GSIN;3
030;RESD;1
028;GSIN;1
Seria possivel?
Tentei assim mas nao consegui:
grep -Ev 'HEADER|TRAILLER' arq.txt | cut -b 1-3 | cut -b 46-49 | sort | uniq
obrigado.
--------------------------------------------
Em qua, 13/7/16, Leandro Valiengo address@hidden [shell-script] <address@hidden> escreveu:
Assunto: Re: [shell-script] Contar registros posicionais
Para: address@hidden
Data: Quarta-feira, 13 de Julho de 2016, 21:09
Oi Fredi,
muito obrigado.
Agora é aperfeiçoar....muito obrigado.
eu utilizo muito o cut -c. Não conhecia o -b
abs,
--------------------------------------------
Em qua, 13/7/16, Fredi Rolf Bieging address@hidden
[shell-script] <address@hidden>
escreveu:
Assunto: Re: [shell-script] Contar registros posicionais
Para: address@hidden
Data: Quarta-feira, 13 de Julho de 2016, 18:42
grep -Ev
'HEADER|TRAILLER' arquivo | cut -b 1-3 | sort |
uniq
-c
grep pra desconsiderar o que
não interessacut pra pegar os três
primeiros caracteressort | uniq pra
ordenar e contar quantos tem de cada um
2016-07-13 18:08 GMT-03:00
Leandro Valiengo address@hidden
[shell-script] <address@hidden>:
Prezados,
boa noite.
Tenho duvidas em como contar a partir de um determinado
valor.
Tenho um arquivo:
00000*HEADER
026531200621068000000010000000201605319353219
026544400621066000000020000000201605319353220
026544400621066000000020000000201605319353221
028544400621066000000020000000201605319353222
026544400621066000000020000000201605319353223
026531205321068000000070000000201605319353225
026531205321061000000020000000201605319353227
035531205321061000000060000000201605319353228
026531205321061000000100000000201605319353229
026531206160553000370730000000201605319536198
026531208560553000332070000000201605319536199
026531208380553000252460000000201605319536200
026531206160542000538890000000201605319536201
026531209180553000223440000000201605319536202
026531206080553000135900000000201605319536203
026531209590553000192650000000201605319536204
026531208360553000578390000000201605319536205
001531208360553001347360000000201605319536206
026531206590553000216510000000201605319536207
99999*TRAILLER000000020
Preciso informar a quantidade de registros por tipo de
movimento (3 primeiras posições). E tenho q
desconsiderar
nessa conta o header (00000) e trailer (99999)
Muito obrigado.
Leo
#yiv4770148894 #yiv4770148894 --
#yiv4770148894ygrp-mkp {
border:1px solid #d8d8d8;font-family:Arial;margin:10px
0;padding:0 10px;}
#yiv4770148894 #yiv4770148894ygrp-mkp hr {
border:1px solid #d8d8d8;}
#yiv4770148894 #yiv4770148894ygrp-mkp #yiv4770148894hd {
color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px
0;}
#yiv4770148894 #yiv4770148894ygrp-mkp #yiv4770148894ads
{
margin-bottom:10px;}
#yiv4770148894 #yiv4770148894ygrp-mkp .yiv4770148894ad {
padding:0 0;}
#yiv4770148894 #yiv4770148894ygrp-mkp .yiv4770148894ad p
{
margin:0;}
#yiv4770148894 #yiv4770148894ygrp-mkp .yiv4770148894ad a
{
color:#0000ff;text-decoration:none;}
#yiv4770148894 #yiv4770148894ygrp-sponsor
#yiv4770148894ygrp-lc {
font-family:Arial;}
#yiv4770148894 #yiv4770148894ygrp-sponsor
#yiv4770148894ygrp-lc #yiv4770148894hd {
margin:10px
0px;font-weight:700;font-size:78%;line-height:122%;}
#yiv4770148894 #yiv4770148894ygrp-sponsor
#yiv4770148894ygrp-lc .yiv4770148894ad {
margin-bottom:10px;padding:0 0;}
#yiv4770148894 #yiv4770148894actions {
font-family:Verdana;font-size:11px;padding:10px 0;}
#yiv4770148894 #yiv4770148894activity {
background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}
#yiv4770148894 #yiv4770148894activity span {
font-weight:700;}
#yiv4770148894 #yiv4770148894activity span:first-child {
text-transform:uppercase;}
#yiv4770148894 #yiv4770148894activity span a {
color:#5085b6;text-decoration:none;}
#yiv4770148894 #yiv4770148894activity span span {
color:#ff7900;}
#yiv4770148894 #yiv4770148894activity span
.yiv4770148894underline {
text-decoration:underline;}
#yiv4770148894 .yiv4770148894attach {
clear:both;display:table;font-family:Arial;font-size:12px;padding:10px
0;width:400px;}
#yiv4770148894 .yiv4770148894attach div a {
text-decoration:none;}
#yiv4770148894 .yiv4770148894attach img {
border:none;padding-right:5px;}
#yiv4770148894 .yiv4770148894attach label {
display:block;margin-bottom:5px;}
#yiv4770148894 .yiv4770148894attach label a {
text-decoration:none;}
#yiv4770148894 blockquote {
margin:0 0 0 4px;}
#yiv4770148894 .yiv4770148894bold {
font-family:Arial;font-size:13px;font-weight:700;}
#yiv4770148894 .yiv4770148894bold a {
text-decoration:none;}
#yiv4770148894 dd.yiv4770148894last p a {
font-family:Verdana;font-weight:700;}
#yiv4770148894 dd.yiv4770148894last p span {
margin-right:10px;font-family:Verdana;font-weight:700;}
#yiv4770148894 dd.yiv4770148894last p
span.yiv4770148894yshortcuts {
margin-right:0;}
#yiv4770148894 div.yiv4770148894attach-table div div a {
text-decoration:none;}
#yiv4770148894 div.yiv4770148894attach-table {
width:400px;}
#yiv4770148894 div.yiv4770148894file-title a,
#yiv4770148894
div.yiv4770148894file-title a:active, #yiv4770148894
div.yiv4770148894file-title a:hover, #yiv4770148894
div.yiv4770148894file-title a:visited {
text-decoration:none;}
#yiv4770148894 div.yiv4770148894photo-title a,
#yiv4770148894 div.yiv4770148894photo-title a:active,
#yiv4770148894 div.yiv4770148894photo-title a:hover,
#yiv4770148894 div.yiv4770148894photo-title a:visited {
text-decoration:none;}
#yiv4770148894 div#yiv4770148894ygrp-mlmsg
#yiv4770148894ygrp-msg p a span.yiv4770148894yshortcuts
{
font-family:Verdana;font-size:10px;font-weight:normal;}
#yiv4770148894 .yiv4770148894green {
color:#628c2a;}
#yiv4770148894 .yiv4770148894MsoNormal {
margin:0 0 0 0;}
#yiv4770148894 o {
font-size:0;}
#yiv4770148894 #yiv4770148894photos div {
float:left;width:72px;}
#yiv4770148894 #yiv4770148894photos div div {
border:1px solid
#666666;min-height:62px;overflow:hidden;width:62px;}
#yiv4770148894 #yiv4770148894photos div label {
color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}
#yiv4770148894 #yiv4770148894reco-category {
font-size:77%;}
#yiv4770148894 #yiv4770148894reco-desc {
font-size:77%;}
#yiv4770148894 .yiv4770148894replbq {
margin:4px;}
#yiv4770148894 #yiv4770148894ygrp-actbar div a:first-child
{
margin-right:2px;padding-right:5px;}
#yiv4770148894 #yiv4770148894ygrp-mlmsg {
font-size:13px;font-family:Arial, helvetica, clean,
sans-serif;}
#yiv4770148894 #yiv4770148894ygrp-mlmsg table {
font-size:inherit;font:100%;}
#yiv4770148894 #yiv4770148894ygrp-mlmsg select,
#yiv4770148894 input, #yiv4770148894 textarea {
font:99% Arial, Helvetica, clean, sans-serif;}
#yiv4770148894 #yiv4770148894ygrp-mlmsg pre,
#yiv4770148894
code {
font:115% monospace;}
#yiv4770148894 #yiv4770148894ygrp-mlmsg * {
line-height:1.22em;}
#yiv4770148894 #yiv4770148894ygrp-mlmsg #yiv4770148894logo
{
padding-bottom:10px;}
#yiv4770148894 #yiv4770148894ygrp-msg p a {
font-family:Verdana;}
#yiv4770148894 #yiv4770148894ygrp-msg
p#yiv4770148894attach-count span {
color:#1E66AE;font-weight:700;}
#yiv4770148894 #yiv4770148894ygrp-reco
#yiv4770148894reco-head {
color:#ff7900;font-weight:700;}
#yiv4770148894 #yiv4770148894ygrp-reco {
margin-bottom:20px;padding:0px;}
#yiv4770148894 #yiv4770148894ygrp-sponsor
#yiv4770148894ov
li a {
font-size:130%;text-decoration:none;}
#yiv4770148894 #yiv4770148894ygrp-sponsor
#yiv4770148894ov
li {
font-size:77%;list-style-type:square;padding:6px 0;}
#yiv4770148894 #yiv4770148894ygrp-sponsor
#yiv4770148894ov
ul {
margin:0;padding:0 0 0 8px;}
#yiv4770148894 #yiv4770148894ygrp-text {
font-family:Georgia;}
#yiv4770148894 #yiv4770148894ygrp-text p {
margin:0 0 1em 0;}
#yiv4770148894 #yiv4770148894ygrp-text tt {
font-size:120%;}
#yiv4770148894 #yiv4770148894ygrp-vital ul li:last-child
{
border-right:none !important;
}
#yiv4770148894
#yiv6511736368 #yiv6511736368 --
#yiv6511736368ygrp-mkp {
border:1px solid #d8d8d8;font-family:Arial;margin:10px
0;padding:0 10px;}
#yiv6511736368 #yiv6511736368ygrp-mkp hr {
border:1px solid #d8d8d8;}
#yiv6511736368 #yiv6511736368ygrp-mkp #yiv6511736368hd {
color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px
0;}
#yiv6511736368 #yiv6511736368ygrp-mkp #yiv6511736368ads {
margin-bottom:10px;}
#yiv6511736368 #yiv6511736368ygrp-mkp .yiv6511736368ad {
padding:0 0;}
#yiv6511736368 #yiv6511736368ygrp-mkp .yiv6511736368ad p {
margin:0;}
#yiv6511736368 #yiv6511736368ygrp-mkp .yiv6511736368ad a {
color:#0000ff;text-decoration:none;}
#yiv6511736368 #yiv6511736368ygrp-sponsor
#yiv6511736368ygrp-lc {
font-family:Arial;}
#yiv6511736368 #yiv6511736368ygrp-sponsor
#yiv6511736368ygrp-lc #yiv6511736368hd {
margin:10px
0px;font-weight:700;font-size:78%;line-height:122%;}
#yiv6511736368 #yiv6511736368ygrp-sponsor
#yiv6511736368ygrp-lc .yiv6511736368ad {
margin-bottom:10px;padding:0 0;}
#yiv6511736368 #yiv6511736368actions {
font-family:Verdana;font-size:11px;padding:10px 0;}
#yiv6511736368 #yiv6511736368activity {
background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}
#yiv6511736368 #yiv6511736368activity span {
font-weight:700;}
#yiv6511736368 #yiv6511736368activity span:first-child {
text-transform:uppercase;}
#yiv6511736368 #yiv6511736368activity span a {
color:#5085b6;text-decoration:none;}
#yiv6511736368 #yiv6511736368activity span span {
color:#ff7900;}
#yiv6511736368 #yiv6511736368activity span
.yiv6511736368underline {
text-decoration:underline;}
#yiv6511736368 .yiv6511736368attach {
clear:both;display:table;font-family:Arial;font-size:12px;padding:10px
0;width:400px;}
#yiv6511736368 .yiv6511736368attach div a {
text-decoration:none;}
#yiv6511736368 .yiv6511736368attach img {
border:none;padding-right:5px;}
#yiv6511736368 .yiv6511736368attach label {
display:block;margin-bottom:5px;}
#yiv6511736368 .yiv6511736368attach label a {
text-decoration:none;}
#yiv6511736368 blockquote {
margin:0 0 0 4px;}
#yiv6511736368 .yiv6511736368bold {
font-family:Arial;font-size:13px;font-weight:700;}
#yiv6511736368 .yiv6511736368bold a {
text-decoration:none;}
#yiv6511736368 dd.yiv6511736368last p a {
font-family:Verdana;font-weight:700;}
#yiv6511736368 dd.yiv6511736368last p span {
margin-right:10px;font-family:Verdana;font-weight:700;}
#yiv6511736368 dd.yiv6511736368last p
span.yiv6511736368yshortcuts {
margin-right:0;}
#yiv6511736368 div.yiv6511736368attach-table div div a {
text-decoration:none;}
#yiv6511736368 div.yiv6511736368attach-table {
width:400px;}
#yiv6511736368 div.yiv6511736368file-title a, #yiv6511736368
div.yiv6511736368file-title a:active, #yiv6511736368
div.yiv6511736368file-title a:hover, #yiv6511736368
div.yiv6511736368file-title a:visited {
text-decoration:none;}
#yiv6511736368 div.yiv6511736368photo-title a,
#yiv6511736368 div.yiv6511736368photo-title a:active,
#yiv6511736368 div.yiv6511736368photo-title a:hover,
#yiv6511736368 div.yiv6511736368photo-title a:visited {
text-decoration:none;}
#yiv6511736368 div#yiv6511736368ygrp-mlmsg
#yiv6511736368ygrp-msg p a span.yiv6511736368yshortcuts {
font-family:Verdana;font-size:10px;font-weight:normal;}
#yiv6511736368 .yiv6511736368green {
color:#628c2a;}
#yiv6511736368 .yiv6511736368MsoNormal {
margin:0 0 0 0;}
#yiv6511736368 o {
font-size:0;}
#yiv6511736368 #yiv6511736368photos div {
float:left;width:72px;}
#yiv6511736368 #yiv6511736368photos div div {
border:1px solid
#666666;min-height:62px;overflow:hidden;width:62px;}
#yiv6511736368 #yiv6511736368photos div label {
color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}
#yiv6511736368 #yiv6511736368reco-category {
font-size:77%;}
#yiv6511736368 #yiv6511736368reco-desc {
font-size:77%;}
#yiv6511736368 .yiv6511736368replbq {
margin:4px;}
#yiv6511736368 #yiv6511736368ygrp-actbar div a:first-child {
margin-right:2px;padding-right:5px;}
#yiv6511736368 #yiv6511736368ygrp-mlmsg {
font-size:13px;font-family:Arial, helvetica, clean,
sans-serif;}
#yiv6511736368 #yiv6511736368ygrp-mlmsg table {
font-size:inherit;font:100%;}
#yiv6511736368 #yiv6511736368ygrp-mlmsg select,
#yiv6511736368 input, #yiv6511736368 textarea {
font:99% Arial, Helvetica, clean, sans-serif;}
#yiv6511736368 #yiv6511736368ygrp-mlmsg pre, #yiv6511736368
code {
font:115% monospace;}
#yiv6511736368 #yiv6511736368ygrp-mlmsg * {
line-height:1.22em;}
#yiv6511736368 #yiv6511736368ygrp-mlmsg #yiv6511736368logo {
padding-bottom:10px;}
#yiv6511736368 #yiv6511736368ygrp-msg p a {
font-family:Verdana;}
#yiv6511736368 #yiv6511736368ygrp-msg
p#yiv6511736368attach-count span {
color:#1E66AE;font-weight:700;}
#yiv6511736368 #yiv6511736368ygrp-reco
#yiv6511736368reco-head {
color:#ff7900;font-weight:700;}
#yiv6511736368 #yiv6511736368ygrp-reco {
margin-bottom:20px;padding:0px;}
#yiv6511736368 #yiv6511736368ygrp-sponsor #yiv6511736368ov
li a {
font-size:130%;text-decoration:none;}
#yiv6511736368 #yiv6511736368ygrp-sponsor #yiv6511736368ov
li {
font-size:77%;list-style-type:square;padding:6px 0;}
#yiv6511736368 #yiv6511736368ygrp-sponsor #yiv6511736368ov
ul {
margin:0;padding:0 0 0 8px;}
#yiv6511736368 #yiv6511736368ygrp-text {
font-family:Georgia;}
#yiv6511736368 #yiv6511736368ygrp-text p {
margin:0 0 1em 0;}
#yiv6511736368 #yiv6511736368ygrp-text tt {
font-size:120%;}
#yiv6511736368 #yiv6511736368ygrp-vital ul li:last-child {
border-right:none !important;
}
#yiv6511736368
[Prev in Thread] Current Thread [Next in Thread]
- Re: [shell-script] Contar registros posicionais, Leandro Valiengo, 2016/07/13
- Re: [shell-script] Contar registros posicionais, Leandro Valiengo, 2016/07/13
- Re: [shell-script] Contar registros posicionais, Julio C. Neves, 2016/07/13
- Re: [shell-script] Contar registros posicionais, Leandro Valiengo, 2016/07/13
- Re: [shell-script] Contar registros posicionais, Julio C. Neves <=
- Re: [shell-script] Contar registros posicionais, hudson, 2016/07/14
- Re: [shell-script] Contar registros posicionais, itamarnet, 2016/07/14
- Re: [shell-script] Contar registros posicionais, itamarnet, 2016/07/14
- Re: [shell-script] Contar registros posicionais, hudson, 2016/07/14
- Re: [shell-script] Contar registros posicionais, Leandro Valiengo, 2016/07/14
- Re: [shell-script] Contar registros posicionais, Leandro Valiengo, 2016/07/14
- Re: [shell-script] Contar registros posicionais, Leandro Valiengo, 2016/07/14
- Re: [shell-script] Contar registros posicionais, itamarnet, 2016/07/14
- Prev by Date: Re: [shell-script] Contar registros posicionais
- Next by Date: Re: [shell-script] Contar registros posicionais
- Previous by thread: Re: [shell-script] Contar registros posicionais
- Next by thread: Re: [shell-script] Contar registros posicionais
- Index(es):