Removing 'bad'chrs from a file

Basil Chupin blchupin at
Fri Oct 8 08:53:40 UTC 2010

On 08/10/2010 18:13, rikona wrote:
> I just installed UB for a friend, and tried to move a previous
> Thunderbird email file to a new TB in her new UB. TB indexed it, but
> many emails are missing after a certain date. I thought I'd look at
> the file with Kate, but Kate says there are 'bad chrs' in the file.
> Perhaps that is the problem with TB indexing.
> It's a big file, about 1 gig. I also found out that trying to work
> with that size file in Kate is essentially impossible. What may be
> swaps take many minutes every time I try to do anything to the file.
> Tail shows me that all the emails are there, and I know the last one
> indexed by TB. One possibility might be to split the file into 3
> chunks - one including up to the one before the last 'good' email,
> another containing perhaps the next 500 lines or so where the problem
> might be, and the third with the rest of the file. That mid-section
> might be small enough to be reasonable to view/fix with an editor.
> Or, is there a way to just fix/remove the 'bad chrs' from a file? All
> [reasonable] {gotta watch out on this list :-) } ideas welcome.
> She'd like to get all her emails back... :-))
> Thanks,
> rikona

Whenever I am about to install a new version of UB (and by this I assume 
that you meant Ubuntu?), I always copy the /.thunderbird (and /.mozilla) 
sub-dir. in /home/<user> to something like an USB flash disc formatted 
with ext3/4 (which will retain any symlinks).

After the new version of Ubuntu has been install, I copy the 
/.thunderbird from the flash disc to the (new) home directory. I then 
install Thunderbird using Synaptic Package Manager - and run TB. TB has 
always picked up all the contents of what I had copied into 
/home/<name>/.thunderbird from the flash disc - and here I am talking 
about this being so for many years.

You don't mention which version of TB you are using to do this nor which 
version of "UB" - but it doesn't really matter because what I stated 
above has been so for me for years for all versions of not only another 
distro but also now for Ubuntu.

Have you tried to create a new Profile for TB, then copy over to it the 
backup copy of /.thunderbird to that new profile?

BTW, I have always used mc (Midnight Commander) for all my work with 
files. Have you tried mc re the above 1GB file?

If you have a copy of the /.thunderbird sub-dir from her previous 
installation then hold on to it as nothing is lost and can be restored...


Went to a discount massage parlour the other day. Wasn't 'til I paid me money that I found out that it was self-service.

More information about the ubuntu-users mailing list