Posted by Caecus on October 25, 2000 at 09:28:53:
In Reply to: Hey! That is pretty damn slick. Thanks Uncle Bob!(nt) posted by Anti-Pumpkin Boy on October 25, 2000 at 09:05:58:
import java.io.*; public class RoleConverter { Now, the way to use this is pretty simple. You write your role in a text file, save it as 'toconv.txt'. Those of you with a JVM (Java virtual machine) can now compile this code and run the file, and it will create a file called "converted.txt".
public static void main(String[] args) {
try {
// define infile, outfile, role string.
final static String INFILE = "toconv.txt",
OUTFILE = "converted.txt",
ROLESTR = "role + ";
BufferedReader in = new BufferedReader(new FileReader(INFILE));
PrintWriter out = new PrintWriter(new FileWriter(OUTFILE));
while((String s=in.readLine())!=null) {
String temp=ROLESTR;
temp+=s;
temp+="\n";
out.println();
}
} catch(IOException e) {}
}
}