I am making app that reduces txt file for my own customs. I found problem that I can't solve. 
I have two arraylist with position of lines between i want to delete text. The problem is that the function count all desired lines and add it to arraylist. So if i delete line 52 the line 62 (next line) will be really line 61 and so on. How can I solve this? 

Here is my function: 

```
    public void countDesiredLines() throws IOException {
    BufferedReader reader = new BufferedReader(new FileReader(
            "D:\\Temp.txt"));

    int lines = 0;

    boolean has_it = false;
    String line = null;
    while ((line = reader.readLine()) != null) {
        lines++;
        if (has_it == true) {
            has_it = false;
            if ("".equals(line)) {
                position.add(lines);

            }
        }
        if (line.startsWith("[Content]")) {
            has_it = true;

        }
    }
    reader.close();
}

```

I've changed it to this but the same error is ocurred.