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

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

Re: [shell-script] Usando awk + sub


From: Leslie Watter
Subject: Re: [shell-script] Usando awk + sub
Date: Mon, 1 Apr 2013 16:18:36 -0300

Oi Gustavo,

Você pode tentar colocar o gsub dentro do if :D que deve funcionar e
atender ao teu caso

awk 'NR=1 {if ( $1 == "JasperPrint" )  gsub("[.-]"," ",$1)};};'
/tmp/jasper2.txt


[]s

LEslie

2013/4/1 Gustavo Soares [SLot] <address@hidden>

> **
>
>
> Acabei usando da forma que você me passou, mas ele imprime TODO o
> documento, como eu delimitei no início para fazer somente a primeira
> linha, não gostaria de ter que usar o head para isso.
>
> Alguma idéia ?
>
> root@testejava:/root>awk 'NR=1 {if ( $1 == "JasperPrint" ) $1 };
> {gsub(/-/," ",$1)}; {gsub(/\./," ",$1); print}' /tmp/jasper2.txt |
> head -n1
>
> LBANCO 703 687
> root@testejava:/root>
>
> Em 01-04-2013 16:06, Leslie Watter escreveu:
> > awk 'gsub(/-/," ",$0)
>
>
> --
> -------------------
> SLot
> Linux User: 124842
> XMPP: address@hidden
>
>  
>



-- 
Leslie H. Watter


[As partes desta mensagem que não continham texto foram removidas]



reply via email to

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