Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Making upper case text in batch files  (Read 23861 times)

0 Members and 1 Guest are viewing this topic.

hussainshoaib

  • Guest
Making upper case text in batch files
« on: June 09, 2004, 09:52:09 AM »
Hi,

I have a batch file with names like "EvoTech". I was wondering if there is any command that can make all the words uppercase. If some command option with SET or ECHO available or any other please let me know.

Thanks,
Hussain

folklore

  • Guest
Re: Making upper case text in batch files
« Reply #1 on: June 09, 2004, 10:05:57 AM »
There is no such command in batch files, at least not as far as I know.

Please give me a little more information:

(1) Do you want to do the case changes during runtime? What this means is that do you want to keep the file as is, but only display it in capitals when you run the file?

(2) Do you want to edit the file and change everything to capitals and then run the file?

For #1, I doubt you will find a solution, but for #2, there are several decent freeware editors available that can transform case for you, for example conTEXT. You can find it at: http://www.fixedsys.com/context/

Regards,

FolkLore

hussainshoaib

  • Guest
Re: Making upper case text in batch files
« Reply #2 on: June 09, 2004, 10:28:31 AM »
I upload those files to server. So basically yes, I want the "EvoTech" to be "EVOTECH" at runtime when it is uploaded to the server, don't care about the original.

Thanks,
Hussain

folklore

  • Guest
Re: Making upper case text in batch files
« Reply #3 on: June 09, 2004, 10:33:11 AM »
As I said - I doubt you will find an easy solution for when you want to change it only during runtime, but if you can edit it before hand it would be simple, right?

Use the text-editor I recommended earlier - conTEXT.

Regards,

FolkLore

hussainshoaib

  • Guest
Re: Making upper case text in batch files
« Reply #4 on: June 09, 2004, 10:53:56 AM »
Thanks a lot. I found a way of doing it using the following batch file.

SET ToUpper=%1
IF [%ToUpper%]==[] GOTO Ending
SET ToUpper=%ToUpper:a=A%
SET ToUpper=%ToUpper:b=B%
SET ToUpper=%ToUpper:c=C%
SET ToUpper=%ToUpper:d=D%
SET ToUpper=%ToUpper:e=E%
SET ToUpper=%ToUpper:f=F%
SET ToUpper=%ToUpper:g=G%
SET ToUpper=%ToUpper:h=H%
SET ToUpper=%ToUpper:i=I%
SET ToUpper=%ToUpper:j=J%
SET ToUpper=%ToUpper:k=K%
SET ToUpper=%ToUpper:l=L%
SET ToUpper=%ToUpper:m=M%
SET ToUpper=%ToUpper:n=N%
SET ToUpper=%ToUpper:o=O%
SET ToUpper=%ToUpper:p=P%
SET ToUpper=%ToUpper:q=Q%
SET ToUpper=%ToUpper:r=R%
SET ToUpper=%ToUpper:s=S%
SET ToUpper=%ToUpper:t=T%
SET ToUpper=%ToUpper:u=U%
SET ToUpper=%ToUpper:v=V%
SET ToUpper=%ToUpper:w=W%
SET ToUpper=%ToUpper:x=X%
SET ToUpper=%ToUpper:y=Y%
SET ToUpper=%ToUpper:z=Z%
:Ending

Hussain

folklore

  • Guest
Re: Making upper case text in batch files
« Reply #5 on: June 09, 2004, 11:03:51 AM »
Excellent - now I have learned something myself! :)

Regards,

FolkLore