Page 1 of 1

Test Works, Replace All does not

Posted: Fri Jul 18, 2008 6:07 pm
by slhilbert
I have a replace that when I run it agaist the test file it works perfectly.

I then try to run the replace against the same file "for real" and I don't get any matches.

Is this normal? Why would it work in test and not in "live" mode?

Thanks,
Stuart

Posted: Fri Jul 18, 2008 7:26 pm
by Bob Hansen
What are all the settings and values in your Replace window?

What class of document is the test file?
What class of document is the real file?

Show samples of before Search and desired text after Replace.

More Details

Posted: Fri Jul 18, 2008 8:01 pm
by slhilbert
The documents are HTML documents.

I am trying to do a traditional find/replace without using regular expressions. When I do this in the test tab, it works. Then when I actually run it, no files are changed. I am presuming the find isn't working.

Here are teh settings have turned on:

Character Encoding: Windows-1252 (I have also tried ISO-8859-1).
Search Sub-Folders are checked and unchecked as I test, no other settings checked.

In the options Literal line break characters I have tried both windows/dos and unix.


Here is example of the code I am looking for:

Code: Select all

<table width="90%" border="0" cellpadding="0" cellspacing="0" align="center">   <tr>      <td bgcolor="#FF6600" width="11%">        <div align="left"><img src="../../genimage/temimage/flvs_template_logo.jpg" width="91" height="34" alt=" " align="absmiddle"></div>     </td>     <td bgcolor="#FF6600" width="38%">        <div align="left"><img src="../../genimage/temimage/copyright.gif" width="138" height="31" align="absmiddle" alt=" "></div>     </td>     <td bgcolor="#FF6600" width="42%">        <div align="right"><a href="../../index.htm"><img name="home" border="0" src="../../genimage/temimage/home.gif" width="70" height="34" alt="home" align="absmiddle"></a></div>     </td>     <td bgcolor="#FF6600" width="9%">        <div align="center"><!-- #BeginEditable "previous" --><a href="01_00.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('previous','','../../genimage/temimage/boxarrow_previous_on.gif',1)"><img name="previous" border="0" src="../../genimage/temimage/boxarrow_previous.gif" width="34" height="34" alt="previous" align="middle"></a><!-- #EndEditable --><!-- #BeginEditable "next" --><a href="01_02.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('next','','../../genimage/temimage/boxarrow_next_on.gif',1)"><img name="next" border="0" src="../../genimage/temimage/boxarrow_next.gif" width="34" height="34" alt="next" align="middle"></a><!-- #EndEditable --></div>     </td>   </tr> </table>
I copied this find code from the test file.

the test file when viewed from the test file window looks like this.

Code: Select all

<html><!-- #BeginTemplate "/Templates/tempstandard.dwt" --><!-- DW6 --> <head> <!-- #BeginEditable "doctitle" -->  <title>1.01 Welcome Page</title> <!-- #EndEditable -->  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!-- #BeginEditable "CourseBuilder" -->  <script language="JavaScript"> <!-- function MM_initInteractions(){}  function MM_swapImgRestore() { //v3.0   var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; }  function MM_preloadImages() { //v3.0   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)     if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} }  function MM_swapImage() { //v3.0   var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} }  function MM_findObj(n, d) { //v4.01   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}   if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);   if(!x && d.getElementById) x=d.getElementById(n); return x; } //--> </script> <!-- #EndEditable -->  </head>  <body bgcolor="#FFFFFF" onLoad="MM_initInteractions();MM_preloadImages('../../genimage/temimage/boxarrow_previous_on.gif','../../genimage/temimage/boxarrow_next_on.gif')"> <table width="90%" border="0" cellpadding="0" cellspacing="0" align="center">   <tr>      <td bgcolor="#FF6600"><img src="../../genimage/temimage/header_img.jpg" width="60" height="34" alt=" " align="absmiddle"><img src="../../genimage/temimage/header_txt.gif" width="168" height="29" alt=" " align="absmiddle"></td>   </tr> </table> <!-- #BeginEditable "edit here" --><br> <table width="90%" border="0" cellspacing="0" cellpadding="5 " align="center">   <tr>      <td><font face="Arial, Helvetica, sans-serif" color="#000000">Congratulations        on your appointment as the head curator of your own virtual museum! </font>        <p><font face="Arial, Helvetica, sans-serif" color="#000000">Your duty is          to travel the world (wide web) in order to stock your museum with virtual          representations of the greatest works of art from around the globe. To complete this task, you must become an expert in art, and, by          the end of this course, you will be! <br>         <br>         Remember that you must also investigate the important works of architecture          in order to select a design for your building. The structure you select          will have 10 salons (or rooms). Here you will display some of the finest          and most important works of art that humanity has produced, and all according        to your own choosing. </font></p>       <p><font face="Arial, Helvetica, sans-serif" color="#000000">As the curator,          you must also be  knowledgeable about your collection and how your          individual pieces relate to the whole of art history. You will          be given a comprehensive test on your virtual journey at the end of your          travels (and you will be rewarded with university credits if you score          well).</font></p>       <p><font face="Arial, Helvetica, sans-serif" color="#000000">Good luck and      have fun!</font></p></td>   </tr> </table> <br> <table width="90%" border="0" cellspacing="0" cellpadding="5" align="center">   <tr>      <td> <div align="center"><img src="../imagmod1/01_01.jpg" width="700" height="473" alt="Pannini - &quot;Picture Gallery with Views of Modern Rome&quot; (mid 18C)"></div></td>   </tr>   <tr>      <td> <p align="center"><font face="Arial, Helvetica, sans-serif" size="-1" color="#000000">Pannini          - &quot;Picture Gallery with Views of Modern Rome&quot; (mid 18C) from          the <a href="http://www.wga.hu/index.html" target="_blank">Web Gallery of Art</a></font></p></td>   </tr> </table> <!-- #EndEditable --><br> <table width="90%" border="0" cellpadding="0" cellspacing="0" align="center">   <tr>      <td bgcolor="#FF6600" width="11%">        <div align="left"><img src="../../genimage/temimage/flvs_template_logo.jpg" width="91" height="34" alt=" " align="absmiddle"></div>     </td>     <td bgcolor="#FF6600" width="38%">        <div align="left"><img src="../../genimage/temimage/copyright.gif" width="138" height="31" align="absmiddle" alt=" "></div>     </td>     <td bgcolor="#FF6600" width="42%">        <div align="right"><a href="../../index.htm"><img name="home" border="0" src="../../genimage/temimage/home.gif" width="70" height="34" alt="home" align="absmiddle"></a></div>     </td>     <td bgcolor="#FF6600" width="9%">        <div align="center"><!-- #BeginEditable "previous" --><a href="01_00.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('previous','','../../genimage/temimage/boxarrow_previous_on.gif',1)"><img name="previous" border="0" src="../../genimage/temimage/boxarrow_previous.gif" width="34" height="34" alt="previous" align="middle"></a><!-- #EndEditable --><!-- #BeginEditable "next" --><a href="01_02.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('next','','../../genimage/temimage/boxarrow_next_on.gif',1)"><img name="next" border="0" src="../../genimage/temimage/boxarrow_next.gif" width="34" height="34" alt="next" align="middle"></a><!-- #EndEditable --></div>     </td>   </tr> </table> <br> </body> <!-- #EndTemplate --></html>
If I open the HTML file in Textpad it looks like this:

Code: Select all

<html><!-- #BeginTemplate "/Templates/tempstandard.dwt" --><!-- DW6 -->
<head>
<!-- #BeginEditable "doctitle" --> 
<title>1.01 Welcome Page</title>
<!-- #EndEditable --> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- #BeginEditable "CourseBuilder" --> 
<script language="JavaScript">
<!--
function MM_initInteractions(){}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//-->
</script>
<!-- #EndEditable --> 
</head>

<body bgcolor="#FFFFFF" onLoad="MM_initInteractions();MM_preloadImages('../../genimage/temimage/boxarrow_previous_on.gif','../../genimage/temimage/boxarrow_next_on.gif')">
<table width="90%" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr> 
    <td bgcolor="#FF6600"><img src="../../genimage/temimage/header_img.jpg" width="60" height="34" alt=" " align="absmiddle"><img src="../../genimage/temimage/header_txt.gif" width="168" height="29" alt=" " align="absmiddle"></td>
  </tr>
</table>
<!-- #BeginEditable "edit here" --><br>
<table width="90%" border="0" cellspacing="0" cellpadding="5 " align="center">
  <tr> 
    <td><font face="Arial, Helvetica, sans-serif" color="#000000">Congratulations 
      on your appointment as the head curator of your own virtual museum! </font> 
      <p><font face="Arial, Helvetica, sans-serif" color="#000000">Your duty is 
        to travel the world (wide web) in order to stock your museum with virtual 
        representations of the greatest works of art from around the globe. To complete this task, you must become an expert in art, and, by 
        the end of this course, you will be! <br>
        <br>
        Remember that you must also investigate the important works of architecture 
        in order to select a design for your building. The structure you select 
        will have 10 salons (or rooms). Here you will display some of the finest 
        and most important works of art that humanity has produced, and all according 
      to your own choosing. </font></p>
      <p><font face="Arial, Helvetica, sans-serif" color="#000000">As the curator, 
        you must also be  knowledgeable about your collection and how your 
        individual pieces relate to the whole of art history. You will 
        be given a comprehensive test on your virtual journey at the end of your 
        travels (and you will be rewarded with university credits if you score 
        well).</font></p>
      <p><font face="Arial, Helvetica, sans-serif" color="#000000">Good luck and 
    have fun!</font></p></td>
  </tr>
</table>
<br>
<table width="90%" border="0" cellspacing="0" cellpadding="5" align="center">
  <tr> 
    <td> <div align="center"><img src="../imagmod1/01_01.jpg" width="700" height="473" alt="Pannini - &quot;Picture Gallery with Views of Modern Rome&quot; (mid 18C)"></div></td>
  </tr>
  <tr> 
    <td> <p align="center"><font face="Arial, Helvetica, sans-serif" size="-1" color="#000000">Pannini 
        - &quot;Picture Gallery with Views of Modern Rome&quot; (mid 18C) from 
        the <a href="http://www.wga.hu/index.html" target="_blank">Web Gallery of Art</a></font></p></td>
  </tr>
</table>
<!-- #EndEditable --><br>
<table width="90%" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr> 
    <td bgcolor="#FF6600" width="11%"> 
      <div align="left"><img src="../../genimage/temimage/flvs_template_logo.jpg" width="91" height="34" alt=" " align="absmiddle"></div>
    </td>
    <td bgcolor="#FF6600" width="38%"> 
      <div align="left"><img src="../../genimage/temimage/copyright.gif" width="138" height="31" align="absmiddle" alt=" "></div>
    </td>
    <td bgcolor="#FF6600" width="42%"> 
      <div align="right"><a href="../../index.htm"><img name="home" border="0" src="../../genimage/temimage/home.gif" width="70" height="34" alt="home" align="absmiddle"></a></div>
    </td>
    <td bgcolor="#FF6600" width="9%"> 
      <div align="center"><!-- #BeginEditable "previous" --><a href="01_00.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('previous','','../../genimage/temimage/boxarrow_previous_on.gif',1)"><img name="previous" border="0" src="../../genimage/temimage/boxarrow_previous.gif" width="34" height="34" alt="previous" align="middle"></a><!-- #EndEditable --><!-- #BeginEditable "next" --><a href="01_02.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('next','','../../genimage/temimage/boxarrow_next_on.gif',1)"><img name="next" border="0" src="../../genimage/temimage/boxarrow_next.gif" width="34" height="34" alt="next" align="middle"></a><!-- #EndEditable --></div>
    </td>
  </tr>
</table>
<br>
</body>
<!-- #EndTemplate --></html>
I assume I should use the Test File format that is displayed in the window of WildEdit to do my finds, but I am not sure.

Thanks,
Stuart

Posted: Fri Jul 18, 2008 9:46 pm
by ben_josephs
The text in the Test window is not the same as the text in your file. The test text consists of a single line, while the file text consists of 100 lines.

Copy the text from the file directly into the test window (not via a browser), and copy the multi-line part of it that you want to search for into the Find what window.