Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Reg: text file into java  RSS feed

 
sri charan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,

i just want to know about how to take a data from .txt file and strore it into java object. Let us assume that .txt file has 3 columns(name, employnumber and address) and 40 rows, and was seperated by ",". How can we seperate this and will take into java object.

as i think we can use string concation and send it into collection class and can use... but when the address line has more than one line how can we take care ....
 
Rob Spoor
Sheriff
Posts: 20895
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems like a CSV file. Check out Accessing File Formats, section "Excel". I really recommend opencsv, it's easy to use.

Moving to I/O.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!