Sign in with
Sign up | Sign in
Your question

How to use Batch File to check CSV files encoded

Last response: in Applications
Share
August 26, 2011 4:31:16 AM

Dear All,
The purpose of this concern is to create an MS-DOS batch file that will check on all the csv files for its encoding. The files should be encoded in UTF-8.
An MS-DOS batch file will be clicked that will perform the following:
• Check all csv files in the folder for its encoding type
• Files that are not in UTF-8 format will be converted o UTF-8 with a new name and keep the old one
• Files that are already in UTF-8 will not be changed
• Generate one log file in txt format for the result
a b L Programming
August 26, 2011 11:42:45 PM

You will need more than an MS-DOS batch file for that. You will need a scripting language like Perl or PHP.
August 28, 2011 2:22:55 AM

PhilFrisbie said:
You will need more than an MS-DOS batch file for that. You will need a scripting language like Perl or PHP.


Thanks PhilFrisbie, could you provide more information on that. If possible, could you create the script for me, it's urgent for out team to done this work in short time. Very appreciate.

a b L Programming
August 28, 2011 5:16:37 AM

There are so many options for the encoding of CSV files that you must look at the spec of the software creating the files so you can determine how to identify whether they are fully UTF-8 or not, and then how to convert them.

For example, a file might be entirely UTF16 with a BOM, and that would be trivial to convert. But a file could be a mix of UTF-8 and UTF-16, and that is more difficult to convert.
!