Looking at your sample data,
354 Azeem 87 86 85 84 83 85 C
81 Usama 98 90 81 83 88 88 C
57 hassan 87 81 90 82 83 84.6 D
9 Akash 78 90 98 81 83 86.4 C
45 Sibgo 78 87 97 79 90 85.4 C
24 Salman 76 78 71 81 98 80.8 D
360 Ans 77 78 71 90 94 82 D |
it would be unreliable to attempt to update this data
in situ, directly within the original file. That's because both individual items of data, and each line as a whole, are of variable length. If you try to alter anything the old and new values may be of differing lengths, and thus in making any alteration some other part of the data could be corrupted.
If each line has the same fixed-width format, for example like this:
354 Azeem 87 86 85 84 83 85 C
81 Usama 98 90 81 83 88 88 C
57 hassan 87 81 90 82 83 84.6 D
9 Akash 78 90 98 81 83 86.4 C
45 Sibgo 78 87 97 79 90 85.4 C
24 Salman 76 78 71 81 98 80.8 D
360 Ans 77 78 71 90 94 82 D |
then it could be possible to modify the data in-place.
However, trying to delete a record would still present a problem. That's because the location within the file where that record used to reside will still be there, it cannot just be made to disappear.
The more general solution I already described, read in the data (one line at a time), and write out the changed version to a separate file.