Lally's File Censorer ========================== This program will go through a specified file and replace any words in this file that match a word in the dictionary file with asterisks. Good for censoring bad words out of slightly profanic files. To Use: censor filename [dictionaryfile] Where: filename: the name of the file you want to censor! (the input file) Filename can be anything DOS allows & should be plain ASCII text (but I haven't tried it with anything else) [dictionaryfile]: in brackets cause it's optional. See below to see when you don't need to supply it. The file contains the words to be censored out of the input file. There are basically two files to my censorer system. These are the executable and the dictionary. Now the only thing is that the program won't search through the system's path for the dictionary (it's my compiler, not me). So what you have to do is either one of three things to have the program find the dictionary file: 1. Have the dictionary file in the current directory 2. Specify the dictionary's filename in the command line after the input file name 3. Set the CENSOR environment variable to the FULL path & filename of the dictionary file. For me, the third is probably the best. The easiest way is to put it in your autoexec.bat file. Just add a line like this to your autoexec.bat file: SET CENSOR=C:\DOS\CENSOR.DCT That is assuming that you have the file in the dos directory. By the way, the file doesn't have to be named censor.dct, it's just the name the program searches for in the current directory if you don't specify one in the command line. The dictionary file is extremely simple. It's just a list of bad words. Just pop in any more that you think should be censored or remove some you don't want censored. They don't have to alphabetized or anything! Sorry, no means for entering comments or any of that fancy stuff, any text found in the dictionary file will be censored out! The restrictions are that the words to be censored can be alphanumeric only. In case you're wondering, I wrote this for two reasons: 1. So I could show some of my friends some cool text files I get off the net without offending some of them 2. To censor some of my C++ source files, sometimes I comment profanely :) (You know how it is after your third bottle JOLT) I wrote it in C++ (with exceptions, classes, & templates for fun) with BC 4.02 (too poor to buy the latest version :( ). Spent about three maybe four 4 hour sessions writing & debugging & rewriting & debugging. Okay, this program here is COMPLETELY FREE OF CHARGE!!! Use, distribute, & modify this as you wish (good luck w/o the source :) I'm not responsible for anything that happens because of this program (unless it's a good thing :). I basically did it while procrastinating from doing my History AP homework (still haven't done it & it's been 3 weeks!) Well, Enjoy! Any questions or comments? ======================================================================= Lally Singh Male, 16 (case you're wondering) lsingh@ids2.idsonline.com ======================================================================= BTW: Don't expect this program to be perfect, I've tested it on some files ranging from 9K to 155K, seemed to work OKish. Also, I don't have too much time to read my email and/or write code cause I have school (Junior Year, High School) & stuff, so don't be offended if I can't respond for a while or at all! I'll try though.