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

Re: tagliare una stringa



Claudio Moratti wrote:
On Thursday 01 December 2005 16:37, Premoli, Roberto wrote:

Salve!
Ho un file pippo che contiene N righe nella forma:

testo_costante: testo_variabile01
testo_costante: testo_variabile02
testo_costante: testo_variabile03

etc etc.

il file lo leggo una riga alla volta con

for i in 'cat pippo'; do
comando $i;
done;

pero' prima di "comando" vorrei eliminare da $i la parte
"testo_costante: "
Come posso fare?
Grassie
Roberto


a memoria....

$ echo "testo_costante: testo_variabile03" | cut -d" " -f2
testo_variabile03

per il resto... man cut

Ciao!

io proverei il comando cut:
echo "$i" | cut -c14-

fammi sapere

--
99% of all test subjects accepted the program, as long as they were given a choice



Reply to: