title: How to Append a json file without disturbing the formatting
body: <p>I'm working on a file to add/retrieve the data. The data format is <strong>JSON</strong>. I'm a newbie.
  I'm using <strong>JSON.NET</strong> to serialize and deserialize the data. 
  this is the JSON format </p>
  
  <pre>{
    "EmpId": 1,
    "Name": "Kaushik",
    "Designation": ".net Developer",
    "JoiningDate": "09/23/2013",
    "Skill": [
      {
        "Id": 1,
        "SkillName": "C#"
      },
      {
        "Id": 2,
        "SkillName": "PHP"
      },
      {
        "Id": 3,
        "SkillName": "java"
      }
    ]
  }</pre>
  
  <p>This is the JSON format I'm working on . 
  Description Of the problem </p>
  
  <ol>
  <li>I want to append the file data so I can add more JSON to this. For this, do I need to check if there is already some data or not?</li>
  <li>I want to append the data in the JSON file. The appended form of data will look like this </li>
  </ol>
  
  <pre>[
      {
          "EmpId": 1,
          "Name": "Kaushik",
          "Designation": ".net Developer",
          "JoiningDate": "09/23/2013",
          "Skill": [
              {
                  "Id": 1,
                  "SkillName": "C#"
              },
              {
                  "Id": 2,
                  "SkillName": "PHP"
              },
              {
                  "Id": 3,
                  "SkillName": "java"
              }
          ]
      },
      {
          "EmpId": 1,
          "Name": "Kaushik",
          "Designation": ".net Developer",
          "JoiningDate": "09/23/2013",
          "Skill": [
              {
                  "Id": 1,
                  "SkillName": "C#"
              },
              {
                  "Id": 2,
                  "SkillName": "PHP"
              },
              {
                  "Id": 3,
                  "SkillName": "java"
              }
          ]
      } ]</pre>
  
  <p>My main problem is that I'm not getting the exact logic to append the file .</p>
  
  <p>I'm reading the file char by char as follows:</p>
  
  <pre class="lang-cs prettyprint-override"><code>int count = 0;
  EmployeeDetail employee = new EmployeeDetail
  {
  
      EmpId = ++count,
      Name = formCollection["Name"],
      Designation = formCollection["Designation"],
      JoiningDate = formCollection["JoiningDate"],
      Skill = new List&lt;Skills&gt;
                      {
                          new Skills(){Id = 1, SkillName = "C#"},
                          new Skills(){Id = 2, SkillName = "PHP"},
                          new Skills(){Id = 3, SkillName = "java"}
                      }
  
  };
  
  string json = JsonConvert.SerializeObject(employee, Formatting.Indented);
  var dataFile = Server.MapPath("~/App_Data/json_data.json");
  //Reading the file 
  StreamReader reader = new StreamReader(dataFile);
  int Tchar = 0;
  char ch;
  do
  {
      ch = (char)reader.Read();
  
      Response.Write(ch);
      Tchar++;
  } while (!reader.EndOfStream);
  reader.Close();
  
  StreamWriter file = new StreamWriter(dataFile, append: true);
  
  file.WriteLine(json);
  
  file.Close()    
  </code></pre>