On Tuesday, 23 September 2025 09:17:58 British Summer Time Peter Humphrey wrote: > On Monday, 22 September 2025 16:50:08 British Summer Time Michael wrote: > > I'll leave the awk scripting for dedup to more capable contributors, but > > if > > this is an one-off problem it may be easier and quicker to run 'tar -tvf > > somearchive.tgz | grep KMailFilters.txt' starting with the most recent > > backup archives. At some point you'll come across an archive which has a > > smaller KMailFilters.txt file size than the current file. Then you can > > extract and diff that file with your current version. > > > > My suggestion falls apart if the duplication of filters was not caused by > > a > > single event, but has crept in progressively over the years. In this case > > a deduplication script will be a better way to approach this. > > It seems I made a mountain out of a molehill. The problem did look pretty > bleak, but the very first backup I tried had what I wanted: a good set of 38 > filters. > > So thank you for your contribution, and apologies for requesting it. I > should have tried before going into text.
No need to apologise, a problem shared is a problem halved after all. :-) Also, your post could have enticed some useful script contribution applicable to other users' problems. Now that you've solved this, it may be more interesting to ascertain what caused it in the first place. Perhaps you used ">>" instead of ">" in a terminal to restore your filters from a backup and thus appended to the original file instead of replacing it?
signature.asc
Description: This is a digitally signed message part.

