Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

I need a script to replace several thousand lines with added text.

html dreamweaver script

Best Answer Vaielab, 05 February 2014 - 09:11 PM

As far as I know, there is no way in dreamweaver or notepad++... or any software that I know of.

But, this could be a really easy script to make in pretty much any language.

 

May I suggest a other solution: do it in css

tr:nth-child(odd) {
...
}
tr:nth-child(even) {
...
} 

Will do the exact same thing, and if ever you add a tr in the beginning, you won't have to redo it all

 

 

If you need old browser to be able to see it, you could use javascript, here a small jquery script that will do the job

$('tr:even').addClass('even');
$('tr:odd').addClass('odd');
Go to the full post


This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1 SZ87

SZ87

    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 05 February 2014 - 08:12 PM

What I need is to edit lines 1, 9, 17, 25, 33, 41, ..., ..., etc. to contain <tr class="odd" height=20 ... ... ...>
 
Then, lines 5, 13, 21, 29, 37, 45, ..., ..., etc. to contain <tr class="even" height=20 ... ... ...>
 
I'm working with Dreamweaver, but also have Notepad++ if I need it.
 
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Gamecube</td>
  <td class=xl64 style='border-top:none;border-left:none'>007: Agent Under Fire</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Gamecube</td>
  <td class=xl64 style='border-top:none;border-left:none'>007: Everything or Nothing</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Gamecube</td>
  <td class=xl64 style='border-top:none;border-left:none'>007: From Russia with Love</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Gamecube</td>
  <td class=xl64 style='border-top:none;border-left:none'>007: Nightfire</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>101-in-1 Party Megamix</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>101-in-1 Sports Party Megamix</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Gamecube</td>
  <td class=xl64 style='border-top:none;border-left:none'>1080° Avalanche</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Gamecube</td>
  <td class=xl64 style='border-top:none;border-left:none'>18 Wheeler: American Pro Trucker</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Gamecube</td>
  <td class=xl64 style='border-top:none;border-left:none'>2002 FIFA World Cup</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>2010 FIFA World Cup South Africa</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wiiware</td>
  <td class=xl64 style='border-top:none;border-left:none'>3-2-1, Rattle Battle!</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wiiware</td>
  <td class=xl64 style='border-top:none;border-left:none'>3D Pixel Racing</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>428: Fuusa Sareta Shibuya de</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>&#332;kami</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>A Boy and His Blob</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wiiware</td>
  <td class=xl64 style='border-top:none;border-left:none'>A Monsteca Corral: Monsters vs. Robots</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>ABBA: You Can Dance</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>Academy O  Champions: Soccer</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>Action Girlz Racing</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>Active Life: Explorer</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>Active Life  Extreme Challenge</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>Active Life: Magical Carnival</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>Active Life: Outdoor Challenge</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>AFL</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>Agatha Christie: And Then There Were None</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>Agatha Christie: Evil Under the Sun</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>Agent Hugo: Hula Holiday</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Wii</td>
  <td class=xl64 style='border-top:none;border-left:none'>Agent Hugo: Lemoon Twist</td>
 </tr>
 <tr height=20 style='height:15.0pt'>
  <td height=20 class=xl63 style='height:15.0pt;border-top:none'>Virtual-console</td>
  <td class=xl64 style='border-top:none;border-left:none'>Air Zonk</td>
 </tr>

Edited by SZ87, 05 February 2014 - 08:14 PM.


#2 Vaielab

Vaielab

    Programming God

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1382 posts

Posted 05 February 2014 - 09:11 PM   Best Answer

As far as I know, there is no way in dreamweaver or notepad++... or any software that I know of.

But, this could be a really easy script to make in pretty much any language.

 

May I suggest a other solution: do it in css

tr:nth-child(odd) {
...
}
tr:nth-child(even) {
...
} 

Will do the exact same thing, and if ever you add a tr in the beginning, you won't have to redo it all

 

 

If you need old browser to be able to see it, you could use javascript, here a small jquery script that will do the job

$('tr:even').addClass('even');
$('tr:odd').addClass('odd');

You can now stalk me on linkedin: http://ca.linkedin.c...elle/24/b44/88/ !


#3 SZ87

SZ87

    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 05 February 2014 - 09:35 PM

That is exactly what I was going for. A simple solution to an otherwise intense and tedious job. Got my rows alternating in color now.

 

Thank you so, so much!


Edited by SZ87, 05 February 2014 - 09:35 PM.





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download