How to use Batch File to check CSV files encoded

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
3 answers Last reply
More about batch file check files encoded
  1. You will need more than an MS-DOS batch file for that. You will need a scripting language like Perl or PHP.
  2. 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.
  3. 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.
Ask a new question

Read More

Programming MS-DOS CSV Encoding Apps