/** * Really basic text extractor, that will also return lots of crud text. * Takes a single argument, the file to extract from */ public static void main(String args[]) throws IOException { if(args.length < 1) { System.err.println("Useage:"); System.err.println("\tQuickButCruddyTextExtractor <file>"); System.exit(1); } String file = args[0]; QuickButCruddyTextExtractor ppe = new QuickButCruddyTextExtractor(file); System.out.println(ppe.getTextAsString()); ppe.close(); }
/** * Fetches the ALL the text of the powerpoint file, in a List of * strings, one per text record */ public List<String> getTextAsVector() { List<String> textV = new ArrayList<>(); // Set to the start of the file int walkPos = 0; // Start walking the file, looking for the records while(walkPos != -1) { walkPos = findTextRecords(walkPos,textV); } // Return what we find return textV; }
/** * Fetches the ALL the text of the powerpoint file, as a single string */ public String getTextAsString() { StringBuffer ret = new StringBuffer(); List<String> textV = getTextAsVector(); for(String text : textV) { ret.append(text); if(! text.endsWith("\n")) { ret.append('\n'); } } return ret.toString(); }
/** * Fetches the ALL the text of the powerpoint file, as a single string */ public String getTextAsString() { StringBuffer ret = new StringBuffer(); Vector<String> textV = getTextAsVector(); for(String text : textV) { ret.append(text); if(! text.endsWith("\n")) { ret.append('\n'); } } return ret.toString(); }
/** * Really basic text extractor, that will also return lots of crud text. * Takes a single argument, the file to extract from */ public static void main(String args[]) throws IOException { if(args.length < 1) { System.err.println("Useage:"); System.err.println("\tQuickButCruddyTextExtractor <file>"); System.exit(1); } String file = args[0]; QuickButCruddyTextExtractor ppe = new QuickButCruddyTextExtractor(file); System.out.println(ppe.getTextAsString()); ppe.close(); }
/** * Fetches the ALL the text of the powerpoint file, in a vector of * strings, one per text record */ public Vector<String> getTextAsVector() { Vector<String> textV = new Vector<String>(); // Set to the start of the file int walkPos = 0; // Start walking the file, looking for the records while(walkPos != -1) { int newPos = findTextRecords(walkPos,textV); walkPos = newPos; } // Return what we find return textV; }