File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How collection.toArray() works?

 
mohan kumar
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you want to show us what you have so far?
(not your entire application, mind you, just the important bits)
 
Krishnan Loganathan
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
mohan kumar
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks guys...and Mr.Dirk Schreckmann link helped me a lot...
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic