Convert UNIX formated text files to DOS formated?

Simon Forman sajmikins at gmail.com
Wed May 13 05:29:50 CEST 2009


On May 12, 4:39 pm, walterbyrd <walterb... at iname.com> wrote:
> I have about 150 unix formated text files that I would like to convert
> to dos formated.
>
> I am guessing that I loop though each file in the directory, read each
> line and conver the last character, then save to a file with the same
> name in another directory.
>
> I am not really sure what I convert the last charactor to.

Python source includes tool for this: lfcr.py

http://svn.python.org/view/python/trunk/Tools/scripts/lfcr.py?view=markup

Depending on how python was installed on your system you might already
have this script on your system.  (FYI there's also a crlf.py script
in the same directory too.)

HTH
~Simon



More information about the Python-list mailing list