Special character is befuddling my batch file
Posted: 04 Dec 2014 04:43
I produce HTML pages for my web site using various batch files. For some reason on the bottom of several pages, there is a special character (at least, that is what it seems to be to me) that looks like a thin line with a small arrow pointing to the right. I would paste the character on this post, but it doesn't copy into this window. On some text editors, the character appears as "^Z", minus the quotation marks.
I believe the character is a line feed break, or a new line delimiter of some kind, because the effect it has on my web pages is to add a blank line at the bottom of the page. The character can be deleted easily enough by hand, but when I try to remove it using any of the command-line search-and-replace batch tools I use, the command line argument halts as soon as the special character is encountered. To be more clear, this is the command line argument (the character is represented in the command line by the "+" symbol, and you can see it toward the end of the CL argument)
"C:\Programs\fnr\fnr.exe" --cl --silent --dir "C:\macros\trades\html" --fileMask "*.html" --excludeFileMask "*.dll, *.exe" --caseSensitive --find "+" --replace ""
I'm basically trying to remove the special character and replace it with nothing; in effect, deleting it altogether. But, I can't do it, because the CL argument stops as soon as the special character occurs. I believe the character has the same effect as hitting the enter key, because the error message I get is this:
" --replace "" is not recognized as an external or internal command.
Those are the words right after the special character, so obviously the character has stopped the CL program dead in its tracks and tries to continue on with a perceived command that is nothing more than a fragment of the command line argument.
I've tried using an escape character, namely, ^, to try and stop the command prompt from interpreting the character as a special command, but I've not had any luck.
Any thoughts on what I can do to make the command line argument work in this case? I would think there would be some way that I could make the special character be perceived in the command window as a regular character, but so far I'm at a loss.
Thanks in advance for any help.
I believe the character is a line feed break, or a new line delimiter of some kind, because the effect it has on my web pages is to add a blank line at the bottom of the page. The character can be deleted easily enough by hand, but when I try to remove it using any of the command-line search-and-replace batch tools I use, the command line argument halts as soon as the special character is encountered. To be more clear, this is the command line argument (the character is represented in the command line by the "+" symbol, and you can see it toward the end of the CL argument)
"C:\Programs\fnr\fnr.exe" --cl --silent --dir "C:\macros\trades\html" --fileMask "*.html" --excludeFileMask "*.dll, *.exe" --caseSensitive --find "+" --replace ""
I'm basically trying to remove the special character and replace it with nothing; in effect, deleting it altogether. But, I can't do it, because the CL argument stops as soon as the special character occurs. I believe the character has the same effect as hitting the enter key, because the error message I get is this:
" --replace "" is not recognized as an external or internal command.
Those are the words right after the special character, so obviously the character has stopped the CL program dead in its tracks and tries to continue on with a perceived command that is nothing more than a fragment of the command line argument.
I've tried using an escape character, namely, ^, to try and stop the command prompt from interpreting the character as a special command, but I've not had any luck.
Any thoughts on what I can do to make the command line argument work in this case? I would think there would be some way that I could make the special character be perceived in the command window as a regular character, but so far I'm at a loss.
Thanks in advance for any help.