Convert from LF to CRLF and vice-versa
Description
Just grab a copy of this script and store in on your computer.
Start a DOS prompt, go in the folder where you've save the script and run it like, f.i.,
cscript convert.vbs C:\Data TXT CRLF
or
cscript convert.vbs . TXT CRLF
The script ask three parameters:
- The folder to process. Specify a folder or just type a dot (
.
) for the current folder, - The extension of files to process. If you wish to process every
.txt
files, just typeTXT
(case insensitive), - Then the desired line endings. If you wish that all files have Windows line endings, type
CRLF
. If a file is with Unix line endings, the file will be converted and rewrite. If you wish the opposite, typeLF
for the third parameter.
Note: the script contains a SILENT_MODE
constant; the default value is false
. If you wish that the script does his job silently, update the constant like this:
Const SILENT_MODE = false
Part of this script is based on the work of Stephen Millard