Aide sur une commande sed

Fermé
saru99 Messages postés 24 Date d'inscription samedi 21 mars 2009 Statut Membre Dernière intervention 23 mars 2009 - 21 mars 2009 à 20:07
saru99 Messages postés 24 Date d'inscription samedi 21 mars 2009 Statut Membre Dernière intervention 23 mars 2009 - 22 mars 2009 à 00:39
Bonjour,
j'ai besoin de votre aide pour transformer ce fichier :

<title>Titre</title>

<date>date</date>
<category>car</category>

Ever find and getting
<fd>blasted number?</fd>

<img src="computer.png"/>

We are unable to find it.

That's right -- links to any sort of music, TV shows, movies,
podcasts, audiobooks or anything else available through Apple's
iTunes store computer before they will display thing one to you.

Is it so unreasonable twser to resolve
to, oh, I don't know, <fd>webbout the
thing you just clicked on?</fd> Is there than
demanding users install information that
could have delivered through the browser?


So here's what we know:

<ul><li> Apple iTunes.</li>
<li> iTunes iPods and iPhones.</li>
<li> iTunes Windows and OS X.</li>
<li> iTunes or buy anything from the iTunes Store.</li></ul>

That'e who own iPods and iPhones --
and or OS X, I suppose.

But what about the rest of the world? Why lock them out with
<a href="https://blog.codinghorror.com/removing-the-login-barrier/">the
ultimate login barrier?</a>We might like to browse the iTunes
Stormaybe some audio clips, how much it costs -- sweet talk me. Make me
want to buy it through the Apple Store. Dazzle me with your
simplicity and ease of use. Beguile me with your wares!

en ce fichier :

<a><title>Titre</title></a>

<a><date>date</date></a>
<a><category>car</category></a>

<a>Ever find and getting
<fd>blasted number?</fd></a>

<a><img src="computer.png"/></a>

<a>We are unable to find it.</a>

<a>That's right -- links to any sort of music, TV shows, movies,
podcasts, audiobooks or anything else available through Apple's
iTunes store computer before they will display thing one to you.</a>

<a>Is it so unreasonable twser to resolve
to, oh, I don't know, <fd>webbout the
thing you just clicked on?</fd> Is there than
demanding users install information that
could have delivered through the browser?</a>


<a>So here's what we know:</a>

<a><ul><li> Apple iTunes.</li>
<li> iTunes iPods and iPhones.</li>
<li> iTunes Windows and OS X.</li>
<li> iTunes or buy anything from the iTunes Store.</li></ul></a>

<a>That'e who own iPods and iPhones --
and or OS X, I suppose.</a>

<a>But what about the rest of the world? Why lock them out with
<a href="https://blog.codinghorror.com/removing-the-login-barrier/">the
ultimate login barrier?</a>We might like to browse the iTunes
Stormaybe some audio clips, how much it costs -- sweet talk me. Make me
want to buy it through the Apple Store. Dazzle me with your
simplicity and ease of use. Beguile me with your wares!<a>



Voilà quelqu'un peut t'il m'aider à metre ces <a> et <a/>

Merci
A voir également:

4 réponses

jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020 4 897
21 mars 2009 à 20:12
Salut,
sed ':z;N;/\n$/!bz;s|\(.*\)\(\n\)|<p>\1</p>\2|' fich.xml
;-))
0
saru99 Messages postés 24 Date d'inscription samedi 21 mars 2009 Statut Membre Dernière intervention 23 mars 2009
21 mars 2009 à 20:36
C'est presque ça, ça marche partt sauf pour les trois premiére ligne où j'ai ça :

<p> <title>Titre</title>

<date>date</date>
<category>car</category><p>



merci
0
jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020 4 897
22 mars 2009 à 00:08
Ben chez moi ça marche :
[tmpfs]$ cat fich.xml
<title>iTunes is Anti-Web</title>

<date> 09-07-2008</date>
<category>Tying (commerce),Apple,multimedia</category>

Ever find yourself clicking on links to music or videos and getting
<strong>blasted in the face with this delightful little number?</strong>

<img src="unable-to-find-itunes-on-your-computer.png"/>

We are unable to find iTunes on your computer.

That's right -- links to any sort of music, TV shows, movies,
podcasts, audiobooks or anything else available through Apple's
iTunes store computer before they will display thing one to you.

Is it so unreasonable to expect links in your browser to resolve
to, oh, I don't know, <strong>web pages containing information about the
thing you just clicked on?</strong> Is there anything more anti-web than
demanding users install custom software to display information that
could have just as easily been delivered through the browser?


So here's what we know:

<lu><li> Apple wants us to install iTunes.</li>
<li> iTunes is necessary to sync media with Apple's iPods and iPhones.</li>
<li> iTunes is only available for Windows and OS X.</li>
<li> iTunes is required to browse or buy anything from the iTunes Store.</li></lu>

That's all well and good for people who own iPods and iPhones --
and happen to be running Windows or OS X, I suppose.

But what about the rest of the world? Why lock them out with
<a href="https://blog.codinghorror.com/removing-the-login-barrier/">the
ultimate login barrier?</a> We might like to browse the iTunes
Store, too. At the very least, I might want some basic information
about the media I just clicked on. Right here in my browser where I
already am. Information like what the heck it is, some artwork,
maybe some audio clips, how much it costs -- sweet talk me. Make me
want to buy it through the Apple Store. Dazzle me with your
simplicity and ease of use. Beguile me with your wares!

[tmpfs]$ sed ':z;N;/\n$/!bz;s|\(.*\)\(\n\)|<p>\1</p>\2|' fich.xml
<p><title>iTunes is Anti-Web</title></p>

<p><date> 09-07-2008</date>
<category>Tying (commerce),Apple,multimedia</category></p>

<p>Ever find yourself clicking on links to music or videos and getting
<strong>blasted in the face with this delightful little number?</strong></p>

<p><img src="unable-to-find-itunes-on-your-computer.png"/></p>

<p>We are unable to find iTunes on your computer.</p>

<p>That's right -- links to any sort of music, TV shows, movies,
podcasts, audiobooks or anything else available through Apple's
iTunes store computer before they will display thing one to you.</p>

<p>Is it so unreasonable to expect links in your browser to resolve
to, oh, I don't know, <strong>web pages containing information about the
thing you just clicked on?</strong> Is there anything more anti-web than
demanding users install custom software to display information that
could have just as easily been delivered through the browser?</p>

<p>
So here's what we know:</p>

<p><lu><li> Apple wants us to install iTunes.</li>
<li> iTunes is necessary to sync media with Apple's iPods and iPhones.</li>
<li> iTunes is only available for Windows and OS X.</li>
<li> iTunes is required to browse or buy anything from the iTunes Store.</li></lu></p>

<p>That's all well and good for people who own iPods and iPhones --
and happen to be running Windows or OS X, I suppose.</p>

<p>But what about the rest of the world? Why lock them out with
<a href="https://blog.codinghorror.com/removing-the-login-barrier/">the
ultimate login barrier?</a> We might like to browse the iTunes
Store, too. At the very least, I might want some basic information
about the media I just clicked on. Right here in my browser where I
already am. Information like what the heck it is, some artwork,
maybe some audio clips, how much it costs -- sweet talk me. Make me
want to buy it through the Apple Store. Dazzle me with your
simplicity and ease of use. Beguile me with your wares! </p>

[tmpfs]$                  
0
saru99 Messages postés 24 Date d'inscription samedi 21 mars 2009 Statut Membre Dernière intervention 23 mars 2009
22 mars 2009 à 00:13
Regards aprés <\date> il n'y a pas la balise sur ton test :

<p><title>iTunes is Anti-Web</title></p>

<p><date> 09-07-2008</date>
<category>Tying (commerce),Apple,multimedia</category></p>


....
Merci
0
jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020 4 897
22 mars 2009 à 00:24
Effectivement, mais en fait la syntaxe se base sur les lignes vides entre les paragraphes et forcément là il n'y a pas de lignes vides, donc...

Désolé mais je ne peux pas mieux faire, à part si dans le code source chaque paragraphe est sur une seule et même ligne.
0
saru99 Messages postés 24 Date d'inscription samedi 21 mars 2009 Statut Membre Dernière intervention 23 mars 2009
22 mars 2009 à 00:39
bonsoir, je viens de comprendre la syntaxe entiérement.
En effet la commande se base sur les sauts de lignes, c'est pr ça dans mon cas je n'avais pas les balises sur les trois premiéres lignes.

Je vais me contenter de ça.

Merci pour tout
0