Boucle while
Bonjour,
j'ai une liste qui contient les nom d fichiers(exple LIL_018_00ad.dat
je voudrai parcourir cette liste et decouper sa comme suite
nom = LIL
toto = 018
titi = 00ad
ensuite (nom,toto,et titi
sont des variable a passer a une proc
comment faire sa s'il vous plais!
j'ai une liste qui contient les nom d fichiers(exple LIL_018_00ad.dat
je voudrai parcourir cette liste et decouper sa comme suite
nom = LIL
toto = 018
titi = 00ad
ensuite (nom,toto,et titi
sont des variable a passer a une proc
comment faire sa s'il vous plais!
Configuration: Windows XP / Internet Explorer 6.0
2 réponses
-
Contributeurhello
$ echo LIL_018_00ad.dat | (while IFS='._' read nom toto titi reste ; do echo $nom $toto $titi ; done ) LIL 018 00ad
-
-
Contributeur@lami20jTotal ou rien !!!
-
Modérateur
-
-
ModérateurSalut,
~$ echo LIL_018_00ad.dat|awk -F"[_.]" '{print "nom="$1 "\ntoto="$2 "\ntiti="$3}' nom=LIL toto=018 titi=00ad