I\'m in a situation to replace some functionalities from a client that operates directly on a CSV file, which used as a config file for a system.
Most of the cases avai
A CSV file is just a sequential text file.
If you want to modify the contents you have to read the entire file into memory, modify it there and write it out again.
Assume a more general case of a file that contains the following:
ABCDEFGHIJKLMNOPQRSTUV
If you want to remove "IJLKM" from the middle you have to read the remainder of the file (NOP...) so you can shuffle it up to meet (...FGH).
If you want to insert "0123456789" in between "M" and "N" you need to read N-Z otherwise the new characters will just overwrite "NOPQRSTUVW".