Mailinglist Archive: opensuse (3151 mails)

< Previous Next >
Re: [opensuse] Need help doing a batch conversation lf - cr/lf
  • From: Randall R Schulz <rschulz@xxxxxxxxx>
  • Date: Thu, 6 Dec 2007 16:13:10 -0800
  • Message-id: <200712061613.11026.rschulz@xxxxxxxxx>
On Thursday 06 December 2007 15:42, Randal Jarrett wrote:
I'm looking for either a utility or simple script (bash/perl) to
convert text files from linux (lf) format to dos (cr/lf).

I need to move over 10k files and maintain the directory
structure while doing it. A lot of the files and some of the
directories have spaces in the name. I can process them on my system
and then move them to the win server. I also have to maintain the
original files & structure.

Any and all assistance is appreciated.

Does telling you to never, ever use Windows count as assistance? No
matter, I use it too...


Anyway, here are some of the elements you have to work with:

- The "find" command
It has an option ("-print0") to print file names with NUL termination
instead of the usual newline termination.

- The "xargs" command
It has an option ("-0"), a counterpart to find's -print0, that makes
it read file names with NUL termination

- The "unix2dos" command
This does the basic text file format conversion.


Check 'em out.


--
Randal Jarrett <rsj@xxxxxxxxx>

Dude! Do you know you spell your name wrong??


Randall Schulz
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References