1.

Solve : Windows Grep - binary vs. txt .html files?

Answer»

I have a BATCH of simple 500-600 character .html files that I am trying to do a simple string replace on. The files are of the exact same structure, ETC., but Windows Grep reads some of them as text files and some as binary. This particular batch isn't "that" big, and it will be a lot of work, and I can manually change them, but for future reference, do you guys have any ideas why some of these files are being read as binary and others aren't.

If anyone cares, here are a couple of examples:

This one it reads as a binary file:

http://www.gridironuniforms.com/matchups/2010/2010_13_CHI_DET.html

and this ones it reads as a text file:

http://www.gridironuniforms.com/matchups/2010/2010_14_GB_DET.html

and how can I get it to read them all as text files so I can batch modify them with Windows Grep. I suppose I can rename them from .html to .txt modify them and change them back, but that seems like extra work. Besides it reads some of them as "text". Why not all?

thanks for any help, suggestions or ideas.


I suspect it's got something to do with the file encoding. Many editors (including Notepad) can save files with different character encodings. (Do File->Save As in Notepad and have a look at the "Encoding" selection box.) Check that your files are encoded in ANSI. Optionally, if you use a programmers' text EDITOR (e.g. PSPad) check that files are being saved with Windows line endings (CR/LF) rather than UNIX line endings (LF).



Discussion

No Comment Found