So I'm trying to add a string into a specific line(for example a line that contains a word) of a JSON file. 

my main problem is after i access the file i don't know how to reach that specific line and put the string inside there.

```
BufferedWriter out = new BufferedWriter(new FileWriter(f,true));
                String newLine=crp.makeLine();
                BufferedReader br= new BufferedReader(new FileReader(f));
                for (int i=0;i<=lineCounter;i++){
                    br.readLine();
                    if(i==lineCounter){
                        out.write(newLine);
                    }
                }

```

I've tried this but it just writes the newLine to the end of the JSON file not the line that i specified through lineCounter