So as I understand I should do it like this:
1. Create new file
2. Create some array of objects from previous file
3. Iterate by my array and change/remove selected rows by id.
4. Then Iterate again if removed and changed the Id value of each (I want the ID == record number)
5. Save the array of objects into my new file.
6. Remove old file
7. Rename new file into old name.
The duplicated code which would be created I should export into interior functions and reuse it in edit and remove functions right?