Natara User Forums: Outline Bloat - Natara User Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Outline Bloat

#1 User is offline   tonyb 

  • Senior Member
  • PipPipPipPipPip
  • Group: Members
  • Posts: 219
  • Joined: 30-June 03
  • Gender:Male
  • Location:London, UK
  • Devices::Non-U3 USB
  • OS:WinXP

Posted 07 August 2009 - 05:34 AM

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
0

#2 User is offline   Richard Murphy 

  • Natara Staff
  • PipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 1291
  • Joined: 26-January 05
  • Gender:Male
  • Location:Naperville
  • Devices::T-Mobile Dash, Dell Axim X51v, iPaq rx3715
  • OS:Win7 x64, WM6, WM 2003SE

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.
Richard Murphy
Natara Software, Inc
http://www.natara.com
0

#3 User is offline   tonyb 

  • Senior Member
  • PipPipPipPipPip
  • Group: Members
  • Posts: 219
  • Joined: 30-June 03
  • Gender:Male
  • Location:London, UK
  • Devices::Non-U3 USB
  • OS:WinXP

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
0

#4 User is offline   slwenglish 

  • Senior Member
  • PipPipPipPipPip
  • Group: Members
  • Posts: 343
  • Joined: 14-May 04
  • Gender:Male
  • Location:Sheffield, UK
  • Devices::Personal iPad (with iThoughtsHD), Employer's Blackberry Bold 9900 and Windows 7 Laptop
  • OS:Windows 7

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
0

#5 User is offline   tonyb 

  • Senior Member
  • PipPipPipPipPip
  • Group: Members
  • Posts: 219
  • Joined: 30-June 03
  • Gender:Male
  • Location:London, UK
  • Devices::Non-U3 USB
  • OS:WinXP

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; }
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users