Solved

batch open and save

Posted on 2011-03-02
5
777 Views
Last Modified: 2012-08-13
Hello
I have hundreds of html files that I need to re-open and resave as utf-8. Does anyone know of a way I could do this without having to open each one in notepad and resaving it?
Thanks
0
Comment
Question by:avir
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:h4mi
ID: 35024853
0
 

Author Comment

by:avir
ID: 35024906
Looks promising. I'll give it a try.
0
 

Author Comment

by:avir
ID: 35024980
The reason why I have to do this is because the files contain Hebrew text which isn't being detected automatically until I change the encoding until I change the encoding in the browser.  I found that when I open a file and resave it with the utf-8 encoding as All Files then it is displayed correctly.
Unfortunately when I run this program,  it turns the Hebrew text that I have in the files into gibberish.
Any other ideas?
0
 
LVL 5

Accepted Solution

by:
h4mi earned 100 total points
ID: 35025727
Do you have the charset tag in your html files?
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
Change utf-8 to the proper charset. Full list can be found here:
http://www.iana.org/assignments/character-sets

Of course, this is not easier than just saving the files in utf-8.
Here is another more manual way of doing it.

1. Download notepad++ from http://notepad-plus-plus.org/download
2. Open a couple of the files in the program
3. Macro>start recording
4. Encoding>change the charset
5. Save the file
6. Close the file
7. Macro>stop recording
8. Open all the files
9. Macro>Run a macro multiple times
10. Enter the amount of files and run

Of course, you should try on one file first in case it turns into gibberish again or similar.
0
 

Author Closing Comment

by:avir
ID: 35026316
I actually don't have the charset tag in the files and I didn't even notice, but thanks for pointing that out. So I'm opening all the files and doing a global replace and putting in all the missing charset tags and that seems to be solving the problem.
Thanks,
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question