int[] fieldsToKeep) throws IOException {
FileTrainingCorpus ftc = new FileTrainingCorpus(trainingCorpus);
Writer writer = new BufferedWriter(new FileWriter(newRawFile));
Iterator<Document> iterator = ftc.iterator();
while (iterator.hasNext()) {
MultiFieldDocument doc = (MultiFieldDocument) iterator.next();
String representation = doc.getStringSerialization(fieldsToKeep);
writer.write(representation);
}
writer.close();
}