If the file is as small as your example, or even if it's several times
bigger, I would just read the whole file into a string, convert it to
a string array using Spreadsheet String to Array, use the array
functions to strip off the unwanted data and append the new data, then
convert and write the whole file out again.

If it's megabytes in size but you have plenty of spare disc space, you
could read the file in one line or block of lines at a time until you
reach the start of the part you want to keep, then open a new file and
start writing the lines/blocks out to the new file as you read them
in, then append the new data, then delete the old file and rename the
new one you have created. There may be a better solution in this case,
but this will certainly work.

I would be interested in others' comments though, because I once
wanted to maintain a rolling buffer like this for audio data (i.e. a
much faster data rate) and I didn't find any simple solutions on
offer.

Reply via email to