I want to remove some information from a text file without shifting its all records. For example a text file customers.txt
is given. it have a lot of records seperated by #
delimiter. and each record contains fields separated by ;
. Like this: 1665;John;Smith
given a customer id, I want to remove a customer with corresponding id. I can find offset and length of the record in the file, but don't know how to remove it. do i have to re-write whole file?
Note: I'm using Standard C++ with g++4.5 and libst4.