Page 1 of 1

Wildedit Works With PHP - Won't Replace HTML Files

Posted: Sat Apr 12, 2008 5:20 am
by notepad
I've used Textpad and Wildedit for a very long time.

Suddenly Wildedit has stopped replacing files in HTML docs. It works fine as usual with PHP files.

I haven't changed any settings or checked any other boxes - everything's pretty much default (I think). I select the dropdown for appropriate filetypes, hit the green go arrow - and nothing happens. :(

Here's what I'm doing:

Find what

Code: Select all

</BODY>
</HTML>
Replace with

Code: Select all

<script type="text/javascript" defer="defer" src="http://server1.opentracker.net/?site=www.samplewebsite.com"></script>
</body>
</html>
Results

Code: Select all

	Time:  2008-Apr-12 00:16:15
	Search Pattern:  </BODY>
</HTML>
	Replacement Format:  <script type="text/javascript" defer="defer" src="http://server1.opentracker.net/?site=www.samplewebsite.com"></script>
</body>
</html>
	Character Encoding:  windows-1252
	Root folder:  C:\Documents and Settings\Owner\My Documents\Glass Co\shower
	File Filter:  *.html *.htm
	Regular Expression:  false
	Replacement Format:  false
	Match Case: false
	Match Words: false
	Search Subfolders:  false

<files omitted for brevity>

Number of files searched: 53
Number of files modified: 0
Total changes made: 0
=== END REPLACE COMMAND ===
Any idea what the problem is?

.

Posted: Sun Apr 13, 2008 9:47 am
by ben_josephs
Changed line endings (Unix to DOS or vice versa)?

Posted: Sun Apr 13, 2008 10:53 am
by notepad
ben_josephs wrote:Changed line endings (Unix to DOS or vice versa)?
In the options tab > Literal line break characters: I selected Linefeed only (Unix) and now I can search and replace in HTML docs.

However, for some reason it's still only accurate a percentage of the time.

Some files don't get changed and I have to manually make changes - which really defeats the purpose of search and replace software.

.

Posted: Sun Apr 13, 2008 12:46 pm
by ben_josephs
WildEdit is sensitive to line endings, and your files have different line endings. Let the line breaks in your regular expression represent line feeds (Literal line break characters: Linefeed only (Unix)) and deal with the optional carriage returns explicitly, by appending \r? at the end of each line in the regular expression.

Posted: Sun Apr 13, 2008 4:31 pm
by notepad
ben_josephs wrote:WildEdit is sensitive to line endings, and your files have different line endings.
I have no idea what you're talking about. Why do you say my files have different line endings?

Here's the common ending they share...

Code: Select all

</BODY> 
</HTML>
...and this is what I wanted it changed to:

Code: Select all

<script type="text/javascript" defer="defer" src="http://server1.opentracker.net/?site=www.samplewebsite.com"></script> 
</body> 
</html>
ben_josephs wrote:Let the line breaks in your regular expression represent line feeds (Literal line break characters: Linefeed only (Unix)) and deal with the optional carriage returns explicitly, by appending \r? at the end of each line in the regular expression.
Sorry but I haven't a clue what you mean. What's a regular expression?

Are you suggesting that I...

1) add \r? to the end of my HTML pages
2) add it to the end of what Wildedit is looking for in my code
3) or add it to the end of the replacement characters?

Or something else... :?:

.

Posted: Sun Apr 13, 2008 8:05 pm
by ben_josephs
You wrote:
I've used ... Wildedit for a very long time.
I assumed from this that you knew something about the tool you are using and would check in its help for anything you were unfamiliar with.

Look in WildEdit's help under Reference | Regular Expression Syntax. If you select Regular expression, the search pattern in the Find what box is a regular expression.

Some of your files are in DOS/Windows format; they have a pair of characters CR, LF (carriage return (\r), line feed (\n)) to mark the end of a line. Others are un Unix format; they have a single character LF to mark the end of a line. I assumed you understood this, because you wrote:
In the options tab > Literal line break characters: I selected Linefeed only (Unix)
I suggested that you add \r? to the end of each line of your search pattern in the Find what box. Select Regular expression.

Posted: Sun Apr 13, 2008 8:59 pm
by notepad
I assumed from this that you knew something about the tool you are using and would check in its help for anything you were unfamiliar with.
I've always used Wildedit successfuly right out of the box without a problem; when I started having the current issue, I read the extensive help files for hours on end and could never find the answer to my problem; so I came here.
Look in WildEdit's help under Reference | Regular Expression Syntax. If you select Regular expression, the search pattern in the Find what box is a regular expression.
I do not have that, or any option selected on the main "replace" panel. Occasionally I might select Search subfolders.
Some of your files are in DOS/Windows format; they have a single character CR (carriage return (\r)) to mark the end of a line. Others are un Unix format; they have a pair of characters CR, LF (carriage return (\r), line feed (\n)) to mark the end of a line.
How do you know this? I do not see any of the characters you describe - other than the code I write.
I assumed you understood this, because you wrote:
Quote:
In the options tab > Literal line break characters: I selected Linefeed only (Unix)
I only selected that option while experimenting for several hours looking for a solution; it worked only partially.
I suggested that you add \r? to the end of each line of your search pattern in the Find what box. Select Regular expression.
That doesn't seem like a desirable solution to what Wildedit is supposed to do already on its own. I mean, we're just talking about simple HTML files here; files that I created with Textpad - and it's always worked on HTML files before.

I never add special characters to search and replace in PHP files; why must one add these characters when working with HTML?

Surely there must be a better solution... :?:

.

Posted: Sun Apr 13, 2008 9:19 pm
by ben_josephs
Have you actually tried my suggestion?

Posted: Sun Apr 13, 2008 9:27 pm
by notepad
ben_josephs wrote:Have you actually tried my suggestion?
I only use Wildedit about 6 or 7 times a year; right now I have no files to replace. Besides, who could remember to add those exact little characters months from now?

Why does Wildedit NOT search & replace today, like it did for me a couple months back? I never had to add special characters before - why now?

I need a simple application for a simple job - nothing special - nothing complicated. I'm a writer - not a programmer.

.

Posted: Sun Apr 13, 2008 9:50 pm
by ben_josephs
You asked for a solution to your problem. You have been offered an explanation of what it is about your files that may have caused the problem, and you have been offered a solution, all free of charge.

You might have tried to understand the cause of your problem and its solution, and even, perhaps, expressed some thanks. Instead, you complained that you don't like the explanation and you declined to try out the proposed solution.

I admit to being confused.

Posted: Sun Apr 13, 2008 10:21 pm
by notepad
You have neglected to address 90% of my questions and concerns. Now you mention "free of charge" ... :?:

If I purchased both Textpad and Wildedit, am I not entitled to free support in this forum?

Furthermore, I don't think I recognize you as being one of the owners or moderators here. Exactly who are you and what is your interest?

As for your replies - I neither liked them nor disliked them. Since you did not respond to my questions, I merely replied with the same questions, over and over again. I had not yet reached the point of thanking you or anyone.

Regardless of that little edge of animosity I detect, your expectations of forum etiquette, or your suggestions above, I still have a problem with Wildedit that previously did not exist.

.

Posted: Mon Apr 14, 2008 1:57 am
by Bob Hansen
OK, settle down, please. Take a deep breath, hold it, OK --- let it out.8)

If there is any animosity, it is not coming from Ben_Joesphs. But you can hear his frustration this time when he is not listened to.

Notepad, you need to realize that Ben_Josephs is really struggling to help you with a solution. It is not his fault if you find a need to do some "programming".

WildEdit is a powerful tool and Ben_Josephs is one of the experts in using it. If you want a good solution to your problem, I need to encourage you to listen to his instructions, and follow his steps, EXACTLY.

If there is something you don't understand, keep coming back and asking for help. You will get all kinds of help here, but I think you may be close to alienating one of the best resources you could have.

There is no "proramming" involved, but you do need to use some special characters so the computer can translate your information and do wnat is needed. You may not realize that there are many "hidden" characters in a line of text on a computer. That is why some special characters are needed.

Good luck, and hang in there, keep asking and working together.

And thanks to Ben_Josephs for his patience, his technical knowledge, and teaching skills. I have learned so much from him and he has made me confident in areas where I once knew nothing.