aspose file tools*
The moose likes Java in General and the fly likes How to read csv file & which collection should be used ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to read csv file & which collection should be used ?" Watch "How to read csv file & which collection should be used ?" New topic
Author

How to read csv file & which collection should be used ?

Rahul B. Shah
Greenhorn

Joined: Jan 17, 2011
Posts: 24
Hello,
Can anyone guide me how to read csv file & which collection is suitable.

csv file :
Name test
FirstName First_Name
LastName Last_Name

Name test2
FirstName First_Name
LastName Last_Name
Email User_Email
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19557
    
  16

Our AccessingFileFormats FAQ lists a few libraries that can read CSV files.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Rahul B. Shah
Greenhorn

Joined: Jan 17, 2011
Posts: 24
Thanks Rob,
I have done following :


I get following output on console :

# Lookup Name
Test Lookup 1

#Type
Refresh

First Name
FIRST_NAME

Last Name
LAST_NAME

ORGANIGATION
USER_ORGANIZATION



# Lookup Name
Test Lookup 2

#Type
Append

First Name
FIRST_NAME

Last Name
LAST_NAME

ORGANIGATION
USER_ORGANIZATION

Email
USER EMAIL

& now i am stuck on how to get these values so that i can use in my function ....

[Edit - added code tags - MB]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
This code will not work for all CSV files, as it ignores several CSV features. CSV is not as trivial to parse as it first looks; that's why Rob pointed you to existing libraries,


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to read csv file & which collection should be used ?
 
Similar Threads
query problem
Auto-increment on CMP EJB + Primary key
XML data to Oracle database
Java ArrayList into Name value pair
Pesudo coding