The problem is the point from where are you writing wont shift rest of the text ahead it will overwrite it so the idea to write in between something is
1- get the index where you want to write
2- get the string after the index and store in some temp variable
3 - write your new text at the index
4- write value of your temp variable.
Replace
string lines = "CELL";
int index = file.IndexOf(lines);
int length = Convert.ToInt32(lines.Length.ToString());
fs2.Seek(length + index + 1, SeekOrigin.Begin);
SW.WriteLine();
SW.WriteLine(hucreKimlik + ' ' + hucreMerkezX + ' ' + hucreMerkezY + ' ' + hucreMerkezZ + ' ' + hucreYaricapi);
With
string lines = "CELLEND";
int index = file.IndexOf(lines);
string restOfTheString = file.Substring(index);
fs2.Seek(index, SeekOrigin.Begin);
SW.WriteLine();
SW.WriteLine(hucreKimlik + ' ' + hucreMerkezX + ' ' + hucreMerkezY + ' ' + hucreMerkezZ + ' ' + hucreYaricapi);
SW.Write(restOfTheString);
Hope this will help
Thanks,
Hemant