Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Replacement in files

Status
Not open for further replies.

cleansedbb

Technical User
Feb 11, 2002
95
US
I have several log files which are in this format:

logfile1.log

<script LANGUAGE=&quot;Javascript&quot;> if (parent.frames[2].ignore.indexOf(&quot;|NickName|&quot;) == -1) {document.write('<font color=color><B><big>NickName</big></B> - Message</font><br>'); } </script>

I tried a

$line1 = &quot;<script LANGUAGE=&quot;Javascript&quot;> if (parent.frames[2].ignore.indexOf(&quot;|&quot;;
$line2 = &quot;|&quot;) == -1) {document.write('&quot;;
$line3 = &quot;'); } </script>&quot;;

$mystr = strtr($addr, &quot;$lin1&quot;, &quot; &quot;);
$mystr = strtr($addr, &quot;$lin2&quot;, &quot; &quot;);
$mystr = strtr($addr, &quot;$lin3&quot;, &quot; &quot;);

all I get is the first < being changed to a square block?

also how would I replace the NickName in |Nickname| ?
would I check for that first then remove the rest of the javascript strings?

Thanks for any help you can give me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top