InputStream input;
try {
input = new FileInputStream(new File(f.fileName()));
ContentHandler textHandler = new BodyContentHandler(-1);
Metadata metadata = new Metadata();
OOXMLParser parser = new OOXMLParser();
ParseContext context = new ParseContext();
parser.parse(input, textHandler, metadata, context);
String[] result = textHandler.toString().split(regex);
for (int i=0; i<result.length && keepRunning; i++) {
if (interrupt) {
processInterrupt();
}