/************************************************************************/
/*  Jeff Balsley                                                        */
/*                                                                      */
/*  This code will re-write a file into lowercase.  It's great if you   */
/*  just need to make a DOS file more readable                          */
/*                                                                      */
/*  gcc lowercase.c -o lowercase                                        */
/************************************************************************/

#include <stdio.h>

int main(void)
{
    char letter[80];
    int tag, count = 0;
    char c;
    
    FILE *inp;
    FILE *outp;

    /*  change input file to whatever your input file is  */ 

    if ((inp = fopen("input.dat", "r")) == 0){
	primtf("\nERROR - Cannot open input file\n");
    }else{
	outp = fopen("output.dat","w");
    
    /*  note, this will write the input file to the output file      */
    /*  however, it will place a ÿ character at the end of the file  */
    /*  so you will need to delete it yourself                       */

    /*  to change all the characters to upper case, change tolower   */
    /*  to toupper          */

	while (c != EOF){
	    c = getc(inp);
	    fprintf(outp, "%c", tolower(c));
	}
    }
    return(0);
}
