CSV Import

Der Zugriff auf Datem im CSV-Format gestaltet sich mit der Bibliothek von “csvreader.com” sehr einfach.

com.csvreader.CsvReader reader = null;
try {
   reader = new CsvReader(file.getAbsolutePath(), ‘;’);
   reader.readHeaders();
   while (reader.readRecord()) {
      String productID = reader.get("Wertstellung");
      System.out.println(">> " + productID);
   }
} catch (Exception ex) {
   ex.printStackTrace();
} finally {
   if (null != reader) reader.close();
}
This entry was posted in Sonstiges. Bookmark the permalink.

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *

*

Du kannst folgende HTML-Tags benutzen: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>