Results 1 to 2 of 2
Thread: Read data from CSV file
- 09-29-2012, 05:10 PM #1
Member
- Join Date
- Feb 2012
- Location
- Norway
- Posts
- 96
- Rep Power
- 0
Read data from CSV file
Hi,
I have this code:
When I run a debugger on this, it reads the file, but it doesn't print... The string variables are empty.Java Code:String filename = textFile.getText(); try { CsvReader cust = new CsvReader(filename); cust.readHeaders(); while (cust.readRecord()) { String name = cust.get(1); String street = cust.get(2); String zip = cust.get(3); String city = cust.get(4); System.out.println(name + ":" + street + ":" + zip + ":" + city); } cust.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }
What could be missing?
- 09-29-2012, 05:30 PM #2
Member
- Join Date
- Feb 2012
- Location
- Norway
- Posts
- 96
- Rep Power
- 0
Similar Threads
-
How to import(read) a data file into jtable
By leszer in forum NetBeansReplies: 1Last Post: 06-04-2012, 05:16 AM -
How to read a Log file and map the data to a table in an RDBMS?
By middlewaredev in forum New To JavaReplies: 6Last Post: 06-03-2011, 10:01 AM -
Read a data from a text file and create an object from these data in this text file
By jjavaa in forum Advanced JavaReplies: 2Last Post: 03-25-2011, 02:36 PM -
Need a solution to read and store data from a file
By sheetalnri in forum New To JavaReplies: 10Last Post: 09-30-2010, 06:43 AM -
Use Scanner to read various types of data from a file
By Java Tip in forum java.langReplies: 0Last Post: 04-17-2008, 07:36 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks