java - How to skip a part of the file then read a line? -
i have code reads file using buffered reader , split, said file created via method automatically adds 4kb of empty space @ beginning of file, results in when read following happens:
first code:
bufferedreader metaread = new bufferedreader(new filereader(metafile)); string metaline = ""; string [] metadata = new string [100000]; while ((metaline = metaread.readline()) != null){ metadata = metaline.split(","); (int = 0; < metadata.length; i++){ system.out.println(metadata[i]); } }
this result, keep in mind file exists , contains values:
//4096 spaces first actual word in document --> testtable2 name java.lang.string true no reference
is there way skip first 4096 spaces, , straight actual value within file can result regularly? because i'll using metadata array later in other operations, , i'm pretty sure spaces mess number of slots within array. suggestions appreciated.
if you're using eclipse, auto-completion should help.
metaread.skip(4096);
https://docs.oracle.com/javase/7/docs/api/java/io/bufferedreader.html
Comments
Post a Comment