Due to a corrupted outline I've been poking around inside a .otl file, and noticed hundreds of entries like this:
<deleted-item id="244888507" />
These entries are taking up a significant portion of the space in the outline. Is it safe to delete them? Is there some way to get Bonsai to do this?
I'm using "desktop only v5.0.1 build 3178".
Thanks,
Tony
Page 1 of 1
Outline Bloat
#2
Posted 07 August 2009 - 12:24 PM
If you are a desktop only user and do not use the outline sync feature, it is safe to delete the "deleted-item" entries. If you sync with a handheld or to another outline, the sync process removes the entries as part of synchronizing the outlines.
#3
Posted 10 February 2011 - 06:26 PM
I forgot about this for a while and now some of my outlines have thousands of these entries. How do I stop them from building up? How do I purge them?
Thanks,
Tony
Thanks,
Tony
#4
Posted 06 January 2012 - 04:45 AM
I've recently switched to running Bonsai USB on my desktop - My Palm no longer syncs with Outlook 2010 and I've had to upgrade my mobile device to a BlackBerry.
I was going to record a Word macro to strip out the <deleted-item id="244888507" /> entries, but Word 2010 has got too clever and recognises the XML data, so the sync data block isn't available to search and delete. Anyone got any ideas about what desktop software could be used to remove that sync block from time to time?
Regards,
Stéph
I was going to record a Word macro to strip out the <deleted-item id="244888507" /> entries, but Word 2010 has got too clever and recognises the XML data, so the sync data block isn't available to search and delete. Anyone got any ideas about what desktop software could be used to remove that sync block from time to time?
Regards,
Stéph
#5
Posted 08 January 2012 - 11:13 AM
I created a powershell script to do this. You'll need to change the folder name near the bottom to wherever your bonsai data is.
The script renames all your .OTL file to .ORIG, and creates new purged .OTL files. This is just something I threw together (there no outline validation or error checking) so you should make sure the new OTL files look OK before you delete the ORIG files.
Regards
Tony
function purge-otl
{
Param([parameter(Mandatory=$true)][string]$fileName)
[xml]$file = get-content $fileName
foreach ($child in $file.ChildNodes) { if ($child.Name -eq "bonsai-outline") { $x1 = $child; break; } }
foreach ($child in $x1.ChildNodes) { if ($child.Name -eq "head") { $x2 = $child; break; } }
foreach ($child in $x2.ChildNodes) { if ($child.Name -eq "sync-info") { $x3 = $child; break; } }
foreach ($child in $x3.ChildNodes) { if ($child.Name -eq "deleted-items") { $x4 = $child; break; } }
if ($x4 -ne $null)
{
[void]$x3.RemoveChild($x4);
}
$new = $fileName.Replace(".OTL", ".OTL.XML")
$file.Save($new)
mv $fileName $fileName.Replace(".OTL", ".ORIG")
mv $new $fileName
}
cd E:\Data\Bonsai
get-childitem "*.OTL" | foreach-object { purge-otl $_.FullName; }
The script renames all your .OTL file to .ORIG, and creates new purged .OTL files. This is just something I threw together (there no outline validation or error checking) so you should make sure the new OTL files look OK before you delete the ORIG files.
Regards
Tony
function purge-otl
{
Param([parameter(Mandatory=$true)][string]$fileName)
[xml]$file = get-content $fileName
foreach ($child in $file.ChildNodes) { if ($child.Name -eq "bonsai-outline") { $x1 = $child; break; } }
foreach ($child in $x1.ChildNodes) { if ($child.Name -eq "head") { $x2 = $child; break; } }
foreach ($child in $x2.ChildNodes) { if ($child.Name -eq "sync-info") { $x3 = $child; break; } }
foreach ($child in $x3.ChildNodes) { if ($child.Name -eq "deleted-items") { $x4 = $child; break; } }
if ($x4 -ne $null)
{
[void]$x3.RemoveChild($x4);
}
$new = $fileName.Replace(".OTL", ".OTL.XML")
$file.Save($new)
mv $fileName $fileName.Replace(".OTL", ".ORIG")
mv $new $fileName
}
cd E:\Data\Bonsai
get-childitem "*.OTL" | foreach-object { purge-otl $_.FullName; }
Share this topic:
Page 1 of 1

Help











