![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Bulk Convert .TXT Files to Unicode Hello, I have a directory containing 300 .txt files in ANSI that I need converted to Unicode. Rather than opening each file in Notepad and saving as Unicode, I'm *really* hopeful that there's a smarter way to do this. Can somebody point me to a script (or other technique) that could save me a ton of time? Thanks! -Ben |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Bulk Convert .TXT Files to Unicode On Nov 18, 3:52 pm, bwi...@xxxxxx wrote: Quote: > Hello, > > I have a directory containing 300 .txt files in ANSI that I need > converted to Unicode. Rather than opening each file in Notepad and > saving as Unicode, I'm *really* hopeful that there's a smarter way to > do this. > > Can somebody point me to a script (or other technique) that could save > me a ton of time? > > Thanks! > > -Ben convert them all. If all of the files in the directory are your text files you can get rid of the If statement. This should do the trick. Set fso = CreateObject("Scripting.FileSystemObject") Set oFolder = fso.GetFolder("C:\Temp") Set oFiles = oFolder.files For each file in oFiles If Right(file.Name, 3) = "txt" Then Set ANSIFile = fso.OpenTextFile(file.path, 1, False, False) ANSIContent = ANSIFile.ReadAll Set UNICODEFile = fso.OpenTextFile(file.path, 2, False, True) UNICODEFile.Write ANSIContent End If Next |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Bulk Unblock of Files | PowerShell | |||
| display unicode (utf-8) files in Windows Console | PowerShell | |||
| Convert Windows-1255 RSS to unicode, so I can call loadXML | VB Script | |||
| How to Bulk Unblock Files | Vista file management | |||
| How to Bulk Unblock Files | Vista General | |||