DOS tool to convert letters in text file to upper/lowercase. (Miscellaneous)
Or, you could write a small program to do this for you. Compile this:
#include <stdio.h>
#define is_upper(A) ((A >= 'A') && (A <= 'Z'))
#define is_lower(A) ((A >= 'a') && (A <= 'z'))
#define to_lower(A) (A - 'A' + 'a')
#define to_upper(A) (A - 'a' + 'A')
int
main()
{
int ch;
while ((ch = getchar()) != EOF) {
if (is_upper(ch)) {
putchar( to_lower(ch) );
}
else {
putchar(ch);
}
}
return 0;
}
This is a very simple program (it doesn't read files, it relies on file redirection) to convert text from uppercase to lowercase. It leaves all other characters as they are (such as punctuation, numbers, etc.)
Save it as tolower.c and compile it with
> WCL tolower.c
(You'll need to install the Watcom C Compiler package and run the OWSETENV.BAT file to set your environment.)
To turn this program into a "convert to uppercase" program, copy the file to toupper.c and change the two lines inside the while loop to this:
if (is_lower(ch)) {
putchar( to_upper(ch) );
Then compile the new program with:
> WCL toupper.c
Complete thread:
- DOS tool to convert letters in text file to upper/lowercase. - Cyberdyne, 28.10.2022, 07:41
- DOS tool to convert letters in text file to upper/lowercase. - mceric, 28.10.2022, 11:00
- DOS tool to convert letters in text file to upper/lowercase. - Cyberdyne, 28.10.2022, 12:45
- DOS tool to convert letters in text file to upper/lowercase. - jhall, 28.10.2022, 16:03
- DOS tool to convert letters in text file to upper/lowercase. - jhall, 28.10.2022, 16:24
- DOS tool to convert letters in text file to upper/lowercase. - jhall, 28.10.2022, 16:47
- DOS tool to convert letters in text file to upper/lowercase. - jhall, 28.10.2022, 16:24
- DOS tool to convert letters in text file to upper/lowercase. - jhall, 28.10.2022, 16:03
- DOS tool to convert letters in text file to upper/lowercase. - Rugxulo, 31.10.2022, 23:55
- DOS tool to convert letters in text file to upper/lowercase. - Cyberdyne, 28.10.2022, 12:45
- DOS tool to convert letters in text file to upper/lowercase. - rr, 28.10.2022, 19:02
- DOS tool to convert letters in text file to upper/lowercase. - Laaca, 28.10.2022, 21:38
- DOS tool to convert letters in text file to upper/lowercase. - RayeR, 15.12.2022, 16:25
- DOS tool to convert letters in text file to upper/lowercase. - bretjohn, 30.10.2022, 02:49
- DOS tool to convert letters in text file to upper/lowercase. - rr, 30.10.2022, 11:38
- DOS tool to convert letters in text file to upper/lowercase. - bretjohn, 31.10.2022, 16:12
- DOS tool to convert letters in text file to upper/lowercase. - rr, 30.10.2022, 11:38
- DOS tool to convert letters in text file to upper/lowercase. - Laaca, 28.10.2022, 21:38
- DOS tool to convert letters in text file to upper/lowercase. - Rugxulo, 29.10.2022, 00:59
- DOS tool to convert letters in text file to upper/lowercase. - Doug, 30.10.2022, 08:47
- DOS tool to convert letters in text file to upper/lowercase. - mceric, 28.10.2022, 11:00