Pages

lundi 13 février 2012

split a string with special character with awk

------To split a string separated by "/", put the results in variable a, and then print the first substring:
set c = `echo "tahiti/la1_22460_mrb01" | awk '{split($0,a,"/");print a[1] }'`

Aucun commentaire:

Enregistrer un commentaire