> Puoi usare awk, per esempio (supponendo che lista.txt contenga solo
> una linea con "5,3,1,10,32" e i campi in output separati da spazi):
Grazie! Funge come unto, e con la piccola modifica
awk -F $’\t’ OFS=“\t” ‘
…
gestisce benissimo il fatto che il pippo.txt sia tab delimited con valori tipo
"1 2” (due numeri inframmezzati da spazio) tra i tabs.
Ciao
F
>
>
> awk -v OFS=" " '
>
> NR == FNR {
> ncols = split($0, cols, /,/)
> next
> }
>
> {
> res = sep = ""
> for (i=1; i <= ncols; i++) {
> res = res sep $cols[i]
> sep = OFS
> }
> print res
>
> }' lista.txt pippo.txt
> _______________________________________________
> Erlug mailing list
> Erlug@xxxxxxxxxxxxxx
> http://erlug.linux.it/cgi-bin/mailman/listinfo/erlug
> -----------------------------------------------------------
> ErLUG webzine: http://erlug.linux.it
> Manuali FDL:
> LinuxFacile - http://linuxfacile.medri.org/
> Linux Da Zero - http://erlug.linux.it/linuxdazero/
> Connettivita' offerta da Ehiweb.it - http://www.ehiweb.it/
> -----------------------------------------------------------
--
Federico Calboli
f.calboli@xxxxxxxxx
|