in reply to delete data from file

Most of the time, there is no such thing as changing a file. Whenever you save changes in a file, the program you use will most likely create a new file and overwrite the old one with the new version. That's what i would recommend.