What will be the most eficient way to split a file in Java ?
Like to get it grid ready…
(Edit)
Modifying the question.
Basically after scouring the net I understand that there are generally two methods followed for file splitting….
-
Just split them by the number of bytes
I guess the advantage of this method is that it is fast, but say I have all the data in a line and suppose the file split puts half the data in one split and the other half the data in another split, then what do I do ??
-
Read them line by line
This will keep my data intact, fine, but I suppose this ain’t as fast as the above method
My first impression is that you have something like a comma separated value (csv) file. The usual way to read / parse those files is to
String#split(String reg)to split a line into values (reg is chosen to match the delimiter)