Parsing of a file using sed I have a file containing lines having this structure :


var marker25 = createMarker(point, '&lt;div id="infowindow" style="white-space: nowrap;"&gt;&lt;h3&gt;Katz\'s Deli&lt;/h3&gt;205 E. Houston Street, Manhattan, New York City,&lt;br /&gt;New York, USA&lt;br /&gt;&lt;br /&gt; &lt;a href="/When_Harry_Met_Sally/filming_locations"&gt;&lt;img style="margin-right: 5px; float: left; width: 100px; height: 150px" src="/images/posters/64-title.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;');
var marker26 = createMarker(point, '&lt;div id="infowindow" style="white-space: nowrap;"&gt;&lt;h3&gt;Rockerfeller Roof Gardens&lt;/h3&gt;5th Avenue between 49th &amp;amp; 50th Streets, Manhattan, New York City,&lt;br /&gt;New York, USA&lt;br /&gt;&lt;br /&gt; &lt;a href="/Spider-man/filming_locations"&gt;&lt;img style="margin-right: 5px; float: left; width: 100px; height: 150px" src="/images/posters/8-title.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;');



I want to quickly be able to have as a result line of this type:

Katz\'s Deli 205 E. Houston Street, Manhattan, New York City,New York, USA,When_Harry_Met_Sally

Rockerfeller Roof Gardens,5th Avenue between 49th &amp;amp; 50th Streets,,New York, USA, Spider-man


To reiterate, I want to remove all HTML/JS strings to keep only addresses, country and so on.

What I did so far is :

grep 'createMarker' New_York_Filming_Locations.php 
cut -d'&lt;' -f1,2,3,4,5,6,7,8  
sed 's/&lt;br \/&gt;/,/g;s/&lt;h3&gt;/,/g;s/&lt;\/h3&gt;/,/g' 
cut -d',' -f3,4,5,7,8,9,11,12 
sed 's/&lt;a href="\///g;s/\/filming_locations"&gt;//g' 
cut -d',' -f1,2,4,5,6,7


It is done in a pipe, but for the clarity of the questions, I put each command on a separate line.

Is this the best way to do it? It is a small file, so I do not care about performance.

The sed syntax can be hard to understand. Do you guys know another way to do it using bash?
Consider removing tags with 

sed 's/&lt;[^&gt;]*&gt;/ /g'