<![CDATA[Forum Ubuntu-fr.org / Utilisation de Sed entre 2 ;]]> http://forum.ubuntu-fr.org/viewtopic.php?id=1106811 Sat, 17 Nov 2012 08:17:37 +0000 FluxBB <![CDATA[Réponse à : Utilisation de Sed entre 2 ;]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=11538111#p11538111 nesthib a écrit :
Postmortem a écrit :

Je l'oublie souvent ce cut, je préfère "l'usine à gaz" awk !

s/l'usine à gaz/le merveilleux langage de programmation/

Hi hi !!
Je suis d'accord avec toi ! Je voulais surtout dire que des fois je m'embarque avec awk alors qu'on peut faire plus simple. Puis pour un débutant, awk peut faire un peu peur !
Mais sinon, moi aussi j'aime awk !!

]]>
Sat, 17 Nov 2012 08:17:37 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=11538111#p11538111
<![CDATA[Réponse à : Utilisation de Sed entre 2 ;]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=11536981#p11536981 Postmortem a écrit :

Je l'oublie souvent ce cut, je préfère "l'usine à gaz" awk !

s/l'usine à gaz/le merveilleux langage de programmation/

]]>
Sat, 17 Nov 2012 01:49:07 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=11536981#p11536981
<![CDATA[Réponse à : Utilisation de Sed entre 2 ;]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=11534451#p11534451 J'ai pas reussi a trouver un tuto claire avec des exemples

J'ai pris "k8055 | awk -F ';' '{print $3}' "  la vrais commande pour le coup et ça marche merci

]]>
Fri, 16 Nov 2012 20:18:13 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=11534451#p11534451
<![CDATA[Réponse à : Utilisation de Sed entre 2 ;]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=11533891#p11533891 Postmortem a écrit :

Il vous en prie ! tongue
Je l'oublie souvent ce cut, je préfère "l'usine à gaz" awk !

Et, moi j'ai fortement douté de mes capacités à utiliser 'awk', alors que c'était l'option '-F' qui me manquait tongue
Quant à sed, je trouve cela trop complexe ... ;-)

]]>
Fri, 16 Nov 2012 19:15:00 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=11533891#p11533891
<![CDATA[Réponse à : Utilisation de Sed entre 2 ;]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=11533701#p11533701 Il vous en prie ! tongue
Je l'oublie souvent ce cut, je préfère "l'usine à gaz", mais tellement merveilleux langage de programmation, awk !
Edit : modifié suite remarque de nethib tongue

]]>
Fri, 16 Nov 2012 18:48:59 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=11533701#p11533701
<![CDATA[Réponse à : Utilisation de Sed entre 2 ;]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=11533531#p11533531 @postmortem: tout simplement merci tongue

]]>
Fri, 16 Nov 2012 18:29:11 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=11533531#p11533531
<![CDATA[Réponse à : Utilisation de Sed entre 2 ;]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=11533221#p11533221 PengouinPdt a écrit :

un truc du genre :

cat file | cut -d ';' -f 3

Le cat et le | sont inutiles :

cut -d ';' -f 3 file
]]>
Fri, 16 Nov 2012 17:51:09 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=11533221#p11533221
<![CDATA[Réponse à : Utilisation de Sed entre 2 ;]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=11533151#p11533151 Merci beaucoup , et rapide avec ça wink

]]>
Fri, 16 Nov 2012 17:47:57 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=11533151#p11533151
<![CDATA[Réponse à : Utilisation de Sed entre 2 ;]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=11533081#p11533081 un truc du genre :

cat file | cut -d ';' -f 3
]]>
Fri, 16 Nov 2012 17:45:35 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=11533081#p11533081
<![CDATA[Réponse à : Utilisation de Sed entre 2 ;]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=11533071#p11533071 Salut,

sed -r 's/([^;]*;){2}([0-9]*).*/\2/' fichier

ou avec awk :

awk -F ';' '{print $3}' fichier

ps : j'ai pas testé !

Edit :
ou :

sed -r 's/([0-9]*;){2}([0-9]*).*/\2/' fichier
]]>
Fri, 16 Nov 2012 17:45:17 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=11533071#p11533071
<![CDATA[Utilisation de Sed entre 2 ;]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=11532981#p11532981 Bonjour,

J'ai un fichier avec des valeurs
26;0;109;0;0;0

Je voudrais récupéré la valeur 109 , a savoir cette valeur peut changé de 0 a 256

J'ai essayé de faire un sed après la 2 eme ; mais j'y arrive pas

Merci

]]>
Fri, 16 Nov 2012 17:37:34 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=11532981#p11532981