File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes IO PerformanceTuning - How to read entire contents from a .csv File without using loop(while/do/for) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "IO PerformanceTuning - How to read entire contents from a .csv File without using loop(while/do/for)" Watch "IO PerformanceTuning - How to read entire contents from a .csv File without using loop(while/do/for)" New topic
Author

IO PerformanceTuning - How to read entire contents from a .csv File without using loop(while/do/for)

rdhinesh kumar
Greenhorn

Joined: Apr 05, 2007
Posts: 2
How to read entire contents from a .csv file without using loop(while/do/for) ?
I have a scenario, which I need to add some string in 1st line of the .csv file. For example, Header Message Text
At end of the line, I need to append some string like footer message. For example, Footer Message Text
So result should be, Header String + Actual Contents from the text file + Footer String


Condition -1
========
I Shouldn't use, with any loop conditions


Why because, if the file size is huge, it will take more time to read and cause performance issue.
Consider the comma-separated values file have 25000+ lines. So, file size will be more than 2MB. The loop will keep on execute.
Maximum within 5 minutes, I need to upload this file. Else the app will throw an error.

Conditions - 2
=========
Only to solve this issue, I shouldn't upgrade java version. We are using Java 4 version only.
Actually there is a solution in Java 7




These 2 condition for performance tuning. The application shouldn't take more than 5 minutes to upload a file.
Within this 5mins I need to alter the content of file and upload a file.

So any solution is there in Java 4 to solve this issue ??

Advise me please...






Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 3133
rdhinesh kumar wrote:How to read entire contents from a .csv file without using loop(while/do/for) ?


Not possible. And why would you want to?


Why because, if the file size is huge, it will take more time to read and cause performance issue.


No.

The I/O is what will take the time, not the looping.
 
 
subject: IO PerformanceTuning - How to read entire contents from a .csv File without using loop(while/do/for)
 
Threads others viewed
Uploading files using applet to server
Problem in csv file upload
BufferedReader.readLine() works in debug, but not run...
CSV Report - Table header missing
JSP EDITOR QUETION? NEED HELP
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com