Re: Convert UNIX formated text files to DOS formated?

2009-05-13 Thread David Robinow
On Tue, May 12, 2009 at 11:47 PM, walterbyrd walterb...@iname.com wrote: On May 12, 6:15 pm, norseman norse...@hughes.net wrote: Subject line says UNIX to DOS I hope that means you are using a UNIX machine. I should have mentioned, I am working in an environment that is very restrictive

Re: Convert UNIX formated text files to DOS formated?

2009-05-13 Thread walterbyrd
On May 13, 3:21 am, David Robinow drobi...@gmail.com wrote: cygwin has u2d and d2u- Hide quoted text - Thank you, I did not know about those utilities, until now. -- http://mail.python.org/mailman/listinfo/python-list

Convert UNIX formated text files to DOS formated?

2009-05-12 Thread walterbyrd
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

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread Diez B. Roggisch
walterbyrd schrieb: 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

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread MRAB
walterbyrd 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

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread walterbyrd
On May 12, 2:53 pm, MRAB goo...@mrabarnett.plus.com wrote: walterbyrd 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

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread MRAB
walterbyrd wrote: On May 12, 2:53 pm, MRAB goo...@mrabarnett.plus.com wrote: walterbyrd 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

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread Terry Reedy
walterbyrd wrote: I have about 150 unix formated text files that I would like to convert to dos formated. Are you sure you need to do that? Most Windows programs (including Python) are happy reading text files with just \n for line endings. --

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread norseman
walterbyrd 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

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread Simon Forman
On May 12, 4:39 pm, walterbyrd walterb...@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

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread walterbyrd
On May 12, 6:12 pm, Terry Reedy tjre...@udel.edu wrote: Are you sure you need to do that?  Most Windows programs (including Python) are happy reading text files with just \n for line endings. These files will be looked at by some non-technical people. I am sure these people will just click on

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread walterbyrd
On May 12, 6:15 pm, norseman norse...@hughes.net wrote: Subject line says UNIX to DOS I hope that means you are using a UNIX machine. I should have mentioned, I am working in an environment that is very restrictive about what I can put on my XP desktop. I can not put python, or even

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread walterbyrd
Thanks for shell script code. That code may be just as efficient, or even more efficient, than python. But, to me, python is far more readable. i=$1 i1=${i%%.*} echo $i1 cat $1 | sed s/^M// $i1._cr ---= import os for file in os.listdir('.'): infile =

Re: Convert UNIX formated text files to DOS formated?

2009-05-12 Thread Jeroen Ruigrok van der Werven
-On [20090513 05:53], walterbyrd (walterb...@iname.com) wrote: As you probably know, cygwin formats to UNIX. That entirely depends on how you install it. Anyway, I am sure the Cygwin repository has the tools dos2unix/unix2dos available for installation. -- Jeroen Ruigrok van der Werven