<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://forum.ubuntu-fr.org/extern.php?action=feed&amp;tid=1133331&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Forum Ubuntu-fr.org / Expressions régulières et sed]]></title>
		<link>http://forum.ubuntu-fr.org/viewtopic.php?id=1133331</link>
		<description><![CDATA[Les sujets les plus récents dans Expressions régulières et sed.]]></description>
		<lastBuildDate>Tue, 11 Dec 2012 15:41:51 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Réponse à&#160;:  Expressions régulières et sed]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11832101#p11832101</link>
			<description><![CDATA[<p>hello<br />et avec ça ?</p><div class="codebox"><pre><code>$ cat fichier
un truc,autre chose,&quot;Let&#039;s Play Halo 3 Part 9.5 &quot;&quot;Escape, High Charity&quot;&quot;&quot;,bidule,machin
un truc,autre chose,&quot;Let&#039;s Play Halo 3 Part 9.5 &quot;Escape&#039;, High Charity&quot;,bidule,machin
un truc,autre chose,&quot;Let&#039;s Play Halo 3 Part 9.5 &quot;&quot;Escape, High Charity&quot;&quot;&quot;,bidule,&quot;pouet, toto&quot;,machin
$ 
$ sed &#039;s/,&quot;/,+/g;s/&quot;,/+,/g;s/+[^+]*+/deleted/g&#039; fichier
un truc,autre chose,deleted,bidule,machin
un truc,autre chose,deleted,bidule,machin
un truc,autre chose,deleted,bidule,deleted,machin
$ </code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (credenhill)]]></author>
			<pubDate>Tue, 11 Dec 2012 15:41:51 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11832101#p11832101</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Expressions régulières et sed]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11814281#p11814281</link>
			<description><![CDATA[<p>Sur la ligne n°2, les <strong>&quot; &quot;</strong> ne sont pas tous appariés.</p><div class="codebox"><pre><code>$ sed -r s&#039;/(&quot;[^&quot;]*&quot;)+/deleted/g&#039; fichier
1) un truc,autre chose,deleted,bidule,machin
2) un truc,autre chose,deletedEscape&#039;, High Charity&quot;,bidule,machin
3) un truc,autre chose,deleted,bidule,deleted,machin</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (pingouinux)]]></author>
			<pubDate>Mon, 10 Dec 2012 10:49:50 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11814281#p11814281</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Expressions régulières et sed]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11813931#p11813931</link>
			<description><![CDATA[<p>Merci, mais :<br />1) j&#039;aimerai remplacer le contenu, pas le supprimer, pour éviter de &quot;casser&quot; les colonnes du csv<br />2) ça ne fonctionne pas si la ligne comporte d&#039;autre quotes<br />ex : un truc,autre chose,&quot;Let&#039;s Play Halo 3 Part 9.5 &quot;&quot;Escape, High Charity&quot;&quot;&quot;,bidule,&quot;pouet, toto&quot;,machin<br /> =&gt; se transforme en : un truc,autre chose,machin</p>]]></description>
			<author><![CDATA[dummy@example.com (cervo)]]></author>
			<pubDate>Mon, 10 Dec 2012 10:26:56 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11813931#p11813931</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Expressions régulières et sed]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11813841#p11813841</link>
			<description><![CDATA[<p>Bonjour,</p><div class="codebox"><pre><code>$ cat fichier
1) un truc,autre chose,&quot;Let&#039;s Play Halo 3 Part 9.5 &quot;&quot;Escape, High Charity&quot;&quot;&quot;,bidule,machin
2) un truc,autre chose,&quot;Let&#039;s Play Halo 3 Part 9.5 &quot;Escape&#039;, High Charity&quot;,bidule,machin

$ sed -r s&#039;/^([^&quot;]*)&quot;.*&quot;,([^&quot;]*)$/\1\2/&#039; fichier
1) un truc,autre chose,bidule,machin
2) un truc,autre chose,bidule,machin</code></pre></div><p><span class="bbu">Ajouté</span> : Plus simple</p><div class="codebox"><pre><code>$ sed -r s&#039;/&quot;.*&quot;,//&#039; fichier</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (pingouinux)]]></author>
			<pubDate>Mon, 10 Dec 2012 10:21:06 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11813841#p11813841</guid>
		</item>
		<item>
			<title><![CDATA[Expressions régulières et sed]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11813661#p11813661</link>
			<description><![CDATA[<p>Salut,</p><p>Je cherche à parser un CSV en ruby via FasterCSV. Le problème est que mon fichier contient des lignes comme :<br />1) un truc,autre chose,&quot;Let&#039;s Play Halo 3 Part 9.5 &quot;&quot;Escape, High Charity&quot;&quot;&quot;,bidule,machin<br />2) un truc,autre chose,&quot;Let&#039;s Play Halo 3 Part 9.5 &quot;Escape&#039;, High Charity&quot;,bidule,machin</p><p>Mon séparateur est donc la virgule.<br />Dans le 1er cas, il me parse en prenant la virgule comme séparateur, donc me retourne un Array [&quot;truc&quot;, &quot;autre chose&quot;, &quot;Let&#039;s Play Halo 3 Part 9.5 &quot;&quot;Escape&quot;, &quot;High Charity&quot;, &quot;bidule&quot;, &quot;machin&quot;]<br />Dans le 2ème cas, une erreur &quot;illegal quoting&quot; m&#039;est retournée.</p><p>J&#039;aimerai donc utiliser sed pour supprimer tout contenu entre guillemets, ça donnerait : truc,autre chose,deleted,bidule,machin<br />Mais j&#039;ai beau utiliser des regexp dans tous les sens, le résultat que j&#039;obtiens n&#039;est pas bon... J&#039;imagine que c&#039;est du aux quotes imbriquées, je ne sais pas comment lui indiquer la bonne expression. J&#039;arrive à m&#039;en sortir avec des regexp simples, mais là je cale.</p><p>Si jamais un champion des expressions régulières pouvait me venir en aide, il illuminerait ma journée, voire ma semaine <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Merci bien</p>]]></description>
			<author><![CDATA[dummy@example.com (cervo)]]></author>
			<pubDate>Mon, 10 Dec 2012 10:03:50 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11813661#p11813661</guid>
		</item>
	</channel>
</rss>
