Mailinglist Archive: opensuse (3151 mails)

< Previous Next >
Re: [opensuse] Need help doing a batch conversation lf - cr/lf
  • From: Randal Jarrett <rsj@xxxxxxxxx>
  • Date: Thu, 06 Dec 2007 23:59:16 -0500
  • Message-id: <1197003556.4921.46.camel@xxxxxxxxxxxxxxx>

I've already been through these cmds and many more but I have been
unable to come
up with a combination that will convert the files and then put them in a
new structure that
has all the same subdirs that the original has.

get file, convert file, put file in the same subdir as original but in
new structure.

I have the new directory structure built. That was easy, find . -type d
-exec mkdir -p ../Dir2/{} \;
where Dir1 was original and Dir2 is the new structure.

I just haven't come up with the right combination to put the files in
the proper subdir under Dir2.
I'm also having problems with




On Thu, 2007-12-06 at 16:13 -0800, Randall R Schulz wrote:
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
--

Randal Jarrett <rsj@xxxxxxxxx>
RSJ Consulting, Inc
Hernando, FL
(352) 419-0112



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

< Previous Next >