If you have trouble running these examples please see Using the Command Line and Helpful Hints For Creating a Command Line.
These examples use the ‘MS Excel’ conversion method (/M1) to convert a XLS file to any file MS Excel can ‘Save As’. Simply change the /C switch in the examples below to the desired target (output) file format. See Excel Conversion File Type Constants for all possible file types and corresponding values for /C.
You can easily change the examples below to handle XLSX files by changing all instances of "XLS" to "XLSX" and changing all instances of "/F-4143" to "/F51".
The first example shows how to convert an Excel file to a dBase IV file.
Each switch shown in blue is described in detail below the examples. It is highly recommended you review each switches description before implementing the example, thereby giving you the full power of ‘Convert XLS’.
Example 1 (Comma Delimited CSV File to ‘dBase IV’)
To convert a single XLS file, "C:\in\input.XLS" to a dBase IV file located in the "C:\Out\" folder, the following syntax would be used:
ConvertXLS.EXE /S"C:\in\input.XLS" /T "C:\Out\output.DBF" /C11 /F-4143 /M1 /V
To convert a whole folder (and subfolders) of files, C:\in\*.XLS to dBase IV files located in the C:\in\ folder, the following syntax would be used:
ConvertXLS.EXE /S"C:\in\*.XLS" /T "C:\in\*.DBF" /C11 /F-4143 /M1 /R /V
The /G switch can be used to tell ‘Convert XLS’ to simply place each output file in the same folder as each input file. Therefore the command line above is equivalent to the command line below:
ConvertXLS.EXE /S"C:\in\*.XLS" /G /C11 /F-4143 /M1 /R /V
You may simply want to convert a whole folder and its subfolders and place the output into a separate folder/drive. In which case use this syntax:
ConvertXLS.EXE /S"C:\in\*.XLS" /T "C:\Out\*.DBF" /C11 /F-4143 /M1 /R /V
· The /S and /T switches above specify Source (input) and Target (output) path respectively and are both required when converting a single file. It is always a good idea to use double quotes around the path especially if there are space characters within the path.
· The /C11 switch specifies that the target (output) file to be a DBF file whereas the /F6 switch specifies the original (input file) is a CSV file. See Excel Conversion File Type Constants for all possible values for /C and /F.
· The /M1 switch tells it to use the ‘MS Excel’ conversion method which has much more target file types to choose from. Note the /M2 switch could have been used however you must be certain the /C switch is available for this conversion method (See Excel Conversion File Type Constants to check).
· The /R switch tells it to search the original folder and its subfolders for files to convert.
· /G switch can be used to tell ‘Convert XLS’ to simply place each output file in the same folder as each input file.
· /N"{Sheet^Range^DelimChar^FixedWidth^X}" Is used when converting to/from an Excel, CSV or fixed width text file. It specifies which Sheets to convert, what Range to convert and what delimitation/separation character to use, and the method to import export to a fixed width text file. The syntax for this parameter is critical, the items are separated by a carrot character "^". In this example we are only using it to specify the ASCII value of the delimitation character of the CSV file.
· The /V (for Verbose) switch is used to give instant feedback by having the program report the status of the conversion with a message box. You can remove this once you have perfected your command line specification. You can also (or instead of /V) create a Log file that will contain the results of the conversion by using the /L switch.
Note: It is highly encouraged that you use the Verbose (/V) switch initially to see what the status of your conversion is and to help you perfect your command line. When in verbose mode the program will tell you what went wrong or right with your command line using message boxes.