[Cascavel-pm] RES: Re: Re: Acesso aleatório à arquivos

Fernando Corrêa de Oliveira fernandocorrea em gmail.com
Terça Fevereiro 22 14:55:33 PST 2011


-1

perl -plE'$z{$`}.=$&if/,.*/;}for(keys%z){$_="$_=>$z{$_}"' arquivo.txt


Em 22/02/2011, às 19:43, Daniel de Oliveira Mantovani escreveu:

> Mas mesmo assim, o seu está bem menor do que eu estava pensando.
> 
> 2011/2/22 Daniel de Oliveira Mantovani <daniel.oliveira.mantovani em gmail.com>:
>> 2011/2/22 Marco Lima <braun.lima em gmail.com>:
>>> Mantovani ! Fail eh vc hehehe o problema foi com o autocomplemento do celular!
>>> 
>> 
>> Eu estava montando o golf com regexp na cabeça, e ia ver isso depois
>> que eu terminasse de trabalhar, aí você mandou um golf com regexp :P
>> 
>>> Fernando vc num disse quantas tacadas e se consegui chegar no green!
>>> 
>>> Marco Lima
>>> Mobile
>>> braun.lima em gmail.com
>>> +55 21 76578103
>>> -----Msg original-----
>>> De: Fernando Corrêa de Oliveira
>>> Enviado:  22/02/2011 19:23:22
>>> Assunto:  Re: [Cascavel-pm] RES: Re: Acesso aleatório à arquivos
>>> 
>>> Po mantovani!!! fail... mas pq?!
>>> Corrigindo, a pedido do mago, o código feito em celular:
>>> 
>>> perl -nE 'if(/(\w+)(\,.*)/){$z{$1}.=$2}END{say"$_=>$z{$_}"for keys%z}' arquivo.txt
>>> 
>>> Em 22/02/2011, às 19:19, Daniel de Oliveira Mantovani escreveu:
>>> 
>>>> 2011/2/22 Marco Lima <braun.lima em gmail.com>:
>>>>> Perl -nE 'if((/\w+)(\,.*)/){$z{$1}.=$2}END{say"$_=>$z{$_}"for key%z}' arquivo.txt
>>>>> 
>>>> 
>>>> fail
>>>> 
>>>>> Nao contei e nem testei pq estou no trânsito! Mas da para passar a idéia . . . Fernando testa e arruma, mas eu quero credito!
>>>>> 
>>>>> Me diz aí se pelo menos acertei no green!
>>>>> 
>>>>> Eden:
>>>>> perl -F, -nalE'push@{$z{shift em F}}, em F}{$"=",";say"$_ => @{$z{$_}}"for
>>>>> keys%z' arquivo.txt
>>>>> 
>>>>> --
>>>>>    Eden Cardim       Need help with your Catalyst or DBIx::Class project?
>>>>>   Code Monkey                    http://www.shadowcat.co.uk/catalyst/
>>>>>  Shadowcat Systems Ltd.  Want a managed development or deployment platform?
>>>>> http://blog.edencardim.com/            http://www.shadowcat.co.uk/servers/
>>>>> _______________________________________________
>>>>> Cascavel-pm mailing list
>>>>> Cascavel-pm em pm.org
>>>>> http://mail.pm.org/mailman/listinfo/cascavel-pm
>>>>> 
>>>>> _______________________________________________
>>>>> Cascavel-pm mailing list
>>>>> Cascavel-pm em pm.org
>>>>> http://mail.pm.org/mailman/listinfo/cascavel-pm
>>>>> 
>>>> 
>>>> 
>>>> 
>>>> --
>>>> "If you’ve never written anything thoughtful, then you’ve never had
>>>> any difficult, important, or interesting thoughts. That’s the secret:
>>>> people who don’t write, are people who don’t think."
>>>> _______________________________________________
>>>> Cascavel-pm mailing list
>>>> Cascavel-pm em pm.org
>>>> http://mail.pm.org/mailman/listinfo/cascavel-pm
>>> 
>>> Just Another Perl Hacker
>>> Fernando Corrêa de Oliveira
>>> fernandocorrea em gmail.com
>>> 
>>> _______________________________________________
>>> Cascavel-pm mailing list
>>> Cascavel-pm em pm.org
>>> http://mail.pm.org/mailman/listinfo/cascavel-pm
>>> 
>>> _______________________________________________
>>> Cascavel-pm mailing list
>>> Cascavel-pm em pm.org
>>> http://mail.pm.org/mailman/listinfo/cascavel-pm
>> 
>> 
>> 
>> --
>> "If you’ve never written anything thoughtful, then you’ve never had
>> any difficult, important, or interesting thoughts. That’s the secret:
>> people who don’t write, are people who don’t think."
>> 
> 
> 
> 
> -- 
> "If you’ve never written anything thoughtful, then you’ve never had
> any difficult, important, or interesting thoughts. That’s the secret:
> people who don’t write, are people who don’t think."
> _______________________________________________
> Cascavel-pm mailing list
> Cascavel-pm em pm.org
> http://mail.pm.org/mailman/listinfo/cascavel-pm

Just Another Perl Hacker
Fernando Corrêa de Oliveira
fernandocorrea em gmail.com



Mais detalhes sobre a lista de discussão Cascavel-pm