0

How do I read a file from a specified position to the end of that line.

Example:

File Contents:

01234567
f1=value
f2=value
f3=value

01234567 = character position. I want it to start reading the line from the "v" in value and I want it to read till the end of the line. So the position would be 3.

2 Answers2

0

Run your text file through colrm first. Or, when reading each line pragmatically, use String.substring.

Steve Kuo
  • 61,876
  • 75
  • 195
  • 257
0

Have a look at FileInputStream.skip

If that doesn't work, you could try reading n bytes from the stream to put at the start read position (preferably via blocks instead of a byte at a time)

MadProgrammer
  • 343,457
  • 22
  • 230
  • 366