Pagina 1 di 1
script bash
Inviato: lun 28 nov 2005, 14:52
da vanescar
ho un file di testo con molte righe scritte... vorrei togliere tutti i questi segni superflui che compaiono sparsi:
|\"£$%&/()=?^´`.¸¸.·*}{[]@#§°-_+ç:;,><
da togliere a mano 1 a 1 mi metto una vita.....
un amico mi ha detto che si potrebbe creare un script bash, per togliere i segni,
se e' vero, come potrei risolvere ??
grazie
Inviato: lun 28 nov 2005, 15:31
da bertolottipf
usa sed o awk
CIAO!
Inviato: lun 28 nov 2005, 15:34
da masalapianta
il modo piu' semplice e' usare tr o sed; come? man tr || man sed
Inviato: lun 28 nov 2005, 16:04
da l1q1d
io uso sed con l`opzione meno -d normalmente
Inviato: lun 28 nov 2005, 16:09
da vanescar
SYNOPSIS
tr [OPTION]... SET1 [SET2]
bash-3.00$
tr -d |\"£$%&/()=?^´`.¸¸.·*}{[]@#§°-_+ç:;,>< file.txt modificato.txt
nn va.....ho il man in inglese, mizzica a scuola andavo maluccio

ora provo tradure il man alla slackware_for_dummies.txt ....
Inviato: lun 28 nov 2005, 16:31
da bertolottipf
esempio
tr -d : < file > new.file
Elimuna i ':' da file file e salva il tutto in new.file
Inviato: lun 28 nov 2005, 16:40
da vanescar
bash-3.00$ tr -d |\"£$%&/()=?^´`.¸¸.·*}{[]@#§°-_+ç:;, <servers.txt> new.txt
>
bash-3.00$ tr -d |\"£$%&/()=?^´`.¸¸.·*}{[]@#§°-_+ç:;, servers.txt > new.txt
>
bash-3.00$ tr -d |\"£$%&/()=?^´`.¸¸.·*}{[]@#§°-_+ç:;, servers.txt new.txt
>
bash-3.00$ tr -d |\"£$%&/()=?^´`.¸¸.·*}{[]@#§°-_+ç:;,<> servers.txt new.txt
>
mi esce sempre sotto: > , e non completa.
ci sono troppi segni da eliminare di colpo ??
Inviato: mar 13 dic 2005, 9:06
da l1q1d
no il problema sono gli apostrofi
Inviato: mar 13 dic 2005, 10:24
da Eurialo