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

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

RES: [shell-script] Transformar texto


From: Rodrigo Vilaça
Subject: RES: [shell-script] Transformar texto
Date: Wed, 7 Jul 2004 12:04:17 -0300


>
>Pessoal,
>como faço para retirar 20040707104157 (yyyymmddhhmmss) deste texto
>Modify: 2004-07-07 10:41:57.000000000 -0300
>


$ echo "2004-07-07 10:41:57.00000000000 -0300" | cut -d. -f1 | sed
's/[^0-9]//g'

20040707104157


cut -d -f1          -> retira o 2004-07-07 10:41:57 ( Primeiro campo
considerando o ponto como delimitador )
sed 's/[^0-9]//g'   -> Substitui tudo que não for número por nada.


[]'s
Rodrigo Vilaça

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.709 / Virus Database: 465 - Release Date: 22/06/2004



reply via email to

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