• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
rdhinesh kumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6109
6
Android IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!