title: Add a new line at a specific position in a text file.
body: <p>I am trying to add a specific line of text in a file. Specifically between two boundaries.</p>
  
  <p>An example of what it would look like if I wanted to add a line in between the boundaries of item1:</p>
  
  <pre><code>[item1]
  2550 coins 995 200000 7
  2550 coins 995 200000 7
  2550 coins 995 200000 7
  2550 coins 995 200000 7
  2550 coins 995 200000 7
  //Add a line here in between the specific boundaries
  [/item1]
  [item2]
  2550 coins 995 200000 7
  2550 coins 995 200000 7
  2550 coins 995 200000 8
  2550 coins 995 200000 7
  2550 coins 995 200000 7
  [/item2]
  [item3]
  2550 coins 995 200000 7
  2550 coins 995 200000 7
  2550 coins 995 200000 7
  2550 coins 995 200000 7
  2550 coins 995 200000 7
  [/item3]
  </code></pre>
  
  <p>This is what I have tried so far, however Its nowhere near correct. It keeps saying that the file is being used by the reader so it cant be edited by the writer, when I did get it to work it cleared the entire document.</p>
  
  <pre><code>public void createEntry(String npcName)
  {
      String line;
      String fileName = "Drops.de";
      StreamWriter streamWriter = new StreamWriter(fileName);
      StreamReader streamReader = new StreamReader(fileName);
      line = streamReader.ReadLine();
      if (line == ("[" + npcName + "]"))
      {
          streamReader.ReadLine();
          streamWriter.WriteLine("Test");
      }
  }
  </code></pre>
  
  <p>I would also like to know how to write lines at the end of the document.</p>