Deleting A Record (ROW)
Read the documentation: https://developers.google.com/apps-script/reference/spreadsheet/sheet#deleteRow(Integer)
You will need a number not a name (TB_Name.txt is a name) - use the index of a list ?
Sorting Your Data
Again read the documentation: https://developers.google.com/apps-script/reference/spreadsheet/range#sortsortspecobj
Modifying the Data
This is more complicated, I will put together an example for you