Build Your Own Arcade Controls Forum
Main => Software Forum => Topic started by: wj2k3 on February 07, 2005, 04:52:29 pm
-
Anybody have any ideas on how to convert a variable from lower case to upper case (or vice versa) in a Batch file.
My problem is that Minwah's Mamewah sends an Upper case rom name and I am trying to match it in a list created by Buddabing's ListGen utility which is lower case. (and then launch his Movie Maker from within Mamewah)
Have searched and Googled and have't come up with a solution yet, other than learn a real programming language. (might have to dive into that)
thanks for any help...
-
Anybody have any ideas on how to convert a variable from lower case to upper case (or vice versa) in a Batch file.
-
I didn't want to create movies for every single game in my filtered list (atleast not yet ;)). It takes quite awhile. Specially when I don't seem to have my filter.SQL file set up 100% correct. I still get games that require me to enter 'ok'. So my computer patiently waits for me to get home from work or to wake up from my slumber (or both ::)) and enter 'ok'.
Also, it will be easier to me to update problem movies by using the latest and greatest SSF files and re-run the production of just a few movies as I come across them.
I just created a Batch file that read the Makemovie.bat and outputed a file with a bunch of if statements. But the if statements require both paramaters to be in the same case.
If you could easily add an -uppercaseromname option, that would be awesome.
Keep up the great work. :)
-
There used to be an old trick to force an argument to upper case: the DOS PATH command would alwyas convert to upper case, so you could do:
@ECHO OFF
SET _MYTMP=%PATH%
PATH %1
ECHO %PATH%
PATH %_TMP%
SET _MYTMP=
save it to upper.bat and then you can do:
C:>upper.bat testing
TESTING
C:>
Haven't tried it in years so not sure it still works under a windows dos box.
Seem a little too complicated for what you need though.
Do you have a text editor, or excel, or something that you coud import the file into and change through a function of that editor?
-
Thanks for the suggestion Papaschtroumpf. I tried that trick but it didn't work. I don't think that Path converts to upper case anymore. When I just type "path" to display what it is currently set to, the path(s) that are displayed have both upper and lower case letters.
I wish it was that easy because I could easily add it to my batch file but alas, no luck.
-
Okay, I've added two options to ListGen:
-force_uppercase_romnames
-force_lowercase_romnames
or, in listgen.ini:
force_uppercase_romnames 1
force_lowercase_romnames 1
The defaults for these options is zero. Forcing lowercase always overrides forcing uppercase if both options are on.
The functions of these options should be fairly obvious :)
I've uploaded a new executable, get it here (http://cpmaker.mameprojects.com/files/LISTGEN.ZIP).
Regards,
Buddabing
-
well you did mention that it would require codeing , and i think you allready have your soultion , but i figured i would toss this on here anyway as i use it all the time .. it's perl , just add/remove the # on the line you want the function for , inputfile is a.txt output is b.txt
$file = "a.txt";
$file2 = "b.txt";
open(IN, "<$file" ) || die "Cannot read file $file\n";
open(OUT, ">$file2") || die "Cannot read file $file2\n";
while (<IN>) {
tr/A-Z/a-z/; # convert to lower case
#tr/a-z/A-Z/; # convert to upper case
print OUT;
}
close IN;
close OUT;