Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Batch conversion to lower case?

337 views
Skip to first unread message

Pai Yili

unread,
Jan 22, 1997, 3:00:00 AM1/22/97
to

Hello,
Using MS-DOS 7.1. Testing indicates that DOS detects
upper and lower case, and will preserve case during copy and xcopy
operations. Is it possible to change upper case to lower case using
DOS. Can it be done in a batch? I am aware of the fact that 4dos is
capable of this, but I do not want to buy 4dos. Timo Saldi? Do you
know how this can be done? <grin>

Best Regards,

Pai Yili
Pai Lum Family Martial Arts
<URL:http://www.users.fast.net/~paiyili/>
Windows 3.1 and '95 Tips and Tweaks!

Tom Lavedas

unread,
Jan 28, 1997, 3:00:00 AM1/28/97
to Pai Yili

Pai Yili wrote:
>
> Hello,
> Using MS-DOS 7.1. Testing indicates that DOS detects
> upper and lower case, and will preserve case during copy and xcopy
> operations. Is it possible to change upper case to lower case using
> DOS. Can it be done in a batch? I am aware of the fact that 4dos is
> capable of this, but I do not want to buy 4dos. Timo Saldi? Do you
> know how this can be done? <grin>

I haven't answered up to now because I don't run Win95 so I can't test
the approach I have in mind. But, since noone else seems to have an
idea I thought I'ld tell you what I know.

I have played with the DIR /L switch a little in the past and know it
can be used to give you a lowercase version of a file's name. What I
don't know is whether you can actually affect the FAT's version of the
file name. However, if COPY and XCOPY preserve the file name's case,
then it may be possible. As I said, I just can't test it.

Below is a batch file that will convert a file name from upper to lower
case. I have tested it in DOS 6.2. You're on your own as far as making
do what you want.
:: LOWER.BAT - A routine that converts a file name to lowercase.
:: Tom Lavedas <k...@deltaelectronics.com>
::
@echo %dbgl% off
%2 if [%1]==[] %0 *.*
%2 for %%v in (%1) do call %0 %%v ::
%2 for %%v in (del goto:End) do %%v ente?.bat
> enter.bat echo ECHO REN %1 "%%4"
> ente}.bat dir %1 /l /b
>>ente}.bat echo.
> ente}.bat date < ente}.bat | find "Ent"
ente}
:End

The routine takes an optional filename argument (which may or may not
need to be capitalized). The filename can have wildcard characters.

You will need to modify the capitalized part of the eighth line to match
your requirements. It may be that this may be as simple as removing the
capped ECHO to activate the REN statement. As it is it simply echos
'REN FILENAME "filename"' to the console. I enclosed the lowercase
filename in quotes in the hope that it will force Win95 to take the file
name literally (not capitalize it).

Let me know how it works out.

Tom Lavedas
-----------
Delta Electronics, Inc.
http://www.deltaelectronics.com

marc stern

unread,
Jan 31, 1997, 3:00:00 AM1/31/97
to

You can do that (and much more) with XSET

XSET Web page: http://members.tripod.com/~marcstern/xset.htm


Pai Yili <pai...@fast.net> wrote in article <5c5obk$9...@news1.fast.net>...

Pai Yili

unread,
Feb 1, 1997, 3:00:00 AM2/1/97
to
Hello,
Thanks for this info, but this problem was solved by Tom
Lavedas with the following batch. The command syntax for using this
batch on a single file is:
lower filename.ext
and will use wildcards, as well.


:: LOWER.BAT - A routine that converts a file name to lowercase.
:: Tom Lavedas <k...@deltaelectronics.com>
::
@echo %dbgl% off
%2 if [%1]==[] %0 *.*
%2 for %%v in (%1) do call %0 %%v ::
%2 for %%v in (del goto:End) do %%v ente?.bat

> enter.bat echo REN %1 "%%4"


> ente}.bat dir %1 /l /b
>>ente}.bat echo.
> ente}.bat date < ente}.bat | find "Ent"
ente}
:End

Best Regards,

Al Aab

unread,
Feb 9, 1997, 3:00:00 AM2/9/97
to


generally,
conversion of text files to another case
is easily done using tr or sed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for a 1stop sed needs, join seders, the informal sed mailing list.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

af...@torfree.net seders informal mailing list & moderator
alt.comp.editors.batch seders news group (more than just sed),
hosted by a seder,
Yiorgos.
http://www.wollery.demon.co.uk seders grab bag (seders official web page)
hosted by a seder,
Casper.
http://www.math.fu-berlin.de/~guckes/sed/ run by a seder, Herr Guckes
http://www.math.fu-berlin.de/~leitner/sed/ run by a seder, Herr Leitner
http://www.dbnet.ece.ntua.gr/~george/#seders seder, engineer, Dr2b Yiorgos
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

--
=-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
al aab, seders moderator sed u soon
it is not zat we do not see the s o l u t i o n
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+

0 new messages