File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes How collection.toArray() works? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How collection.toArray() works?" Watch "How collection.toArray() works?" New topic
Author

How collection.toArray() works?

mohan kumar
Greenhorn

Joined: Apr 16, 2007
Posts: 11
Hi friends,
In my workspace i am facing a problem.
In my java code i have a collection which contains the data like
Account No, Account Type, Currency, Transaction Date, Transaction Id, Channel Description, Description, Debit Amount, Credit Amount
.
I want this data to be exported to CSV format.So i created a out stream.I changed the collection to array.Now i want to iterate the array and create a CSV file in the above mentioned format.I don't know how to do that.

Kindly help me in this issue.

Thanks
Mohan
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Did you want to show us what you have so far?
(not your entire application, mind you, just the important bits)
Krishnan Loganathan
Greenhorn

Joined: Apr 24, 2004
Posts: 23
Hi Mohan,

Are you storing the data inside an Object and then add that object in the Collection or adding the data in comma seperated format as a String ?. Please clarify me.

Regards,
Loga
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
mohan,

It's not clear to me which part of this task you're stuck on.

If you're unfamiliar with working with arrays in Java, part 9 of Bradly Kjell's "Introduction to Computer Science using Java" includes good lessons and practice exercises to help learn the subject.

If you're not yet comfortable writing data to a text file, chapters 82, 83 and 87 in part 13 of Kjell's lessons cover the subject well.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
mohan kumar
Greenhorn

Joined: Apr 16, 2007
Posts: 11
thanks guys...and Mr.Dirk Schreckmann link helped me a lot...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How collection.toArray() works?
 
Similar Threads
Reading a CSV file and storing it into an array and then displaying it on a HTML screen
clicking submit button multiple times
suggest me the possible ways of doing it?
Study Project specs...
Just Can't figure it out and it's due today