Created
March 29, 2012 17:20
-
-
Save Linusstrom/2240236 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
public class Frastrad { | |
public static void main(String[] args){ | |
try { | |
BufferedReader reader = | |
new BufferedReader(new FileReader(args[0])); | |
BufferedWriter writer = | |
new BufferedWriter(new FileWriter(args[1])); | |
String line = reader.readLine(); | |
while(line != null) { | |
String[] splitter = line.split(" "); | |
line = reader.readLine(); | |
for(int i = 0; i < splitter.length; i++) { | |
if(splitter[i].endsWith(")") && splitter[i].length() > 1) { | |
writer.write(splitter[i].substring(0, splitter[i].length() - 1) + " "); | |
} | |
} | |
writer.write("\n"); | |
} | |
writer.close(); | |
reader.close(); | |
} | |
catch(IOException e) { | |
System.err.println("The file " + args[0] + | |
"does not exist."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment