How to use Batch File to check CSV files encoded

caoyan10

Distinguished
Aug 26, 2011
2
0
18,510
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
 

caoyan10

Distinguished
Aug 26, 2011
2
0
18,510


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.

 

PhilFrisbie

Distinguished
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.