From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: Merging .org files Date: Sun, 30 Jan 2011 16:51:02 -0500 Message-ID: <8739oadprt.fsf@fastmail.fm> References: <4D454DF7.8020907@obsebre.es> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=33118 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjfAz-0005fl-75 for emacs-orgmode@gnu.org; Sun, 30 Jan 2011 16:51:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PjfAp-0006Rd-FI for emacs-orgmode@gnu.org; Sun, 30 Jan 2011 16:51:08 -0500 Received: from out1.smtp.messagingengine.com ([66.111.4.25]:35816) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PjfAp-0006QW-CN for emacs-orgmode@gnu.org; Sun, 30 Jan 2011 16:51:07 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Pere Quintana =?utf-8?Q?Segu=C3=AD?= Cc: Org Mode Pere Quintana Segu=C3=AD writes: > In my current system, I have about 200 .org files. With this number of > files, building the agenda is very slow in my home computer and, also, > makes the performance of MobileOrg quite poor. > > So, I would like to join files, to increase the system's performance. FWIW, I've found the opposite to be true. Splitting up larger files and reducing the depth of the hierarchy marginally improves agenda performance (~ 0.2 seconds acc. to elp). But in my case, I split 10 files into 40, so I have no idea what 200 files would do. Perhaps there's a sweet spot somewhere? I also haven't used mobile org. In my experience, archiving old items and reducing the number of active todos is the best way to keep the agenda snappy. > Is there any script to cleanly join files, by transforming the title of > the file in a first level heading (*) and adding an star to all other > headings of the file? Perl is always handy for this type of thing: --8<---------------cut here---------------start------------->8--- #!/usr/bin/perl use strict; use warnings; my $mergefile =3D "/tmp/merged.org"; open NEWFILE, ">", $mergefile=20 or die "Can't open $mergefile: $!"; while (<>) { s/^(\*+)/*$1/; s/^#\+TITLE:\s+(.*)$/* $1/; s/^(#\+\w+:.*)$/: $1/; print NEWFILE "$_"; } close NEWFILE; --8<---------------cut here---------------end--------------->8--- Note: This is a quick proof of concept. Use at your own risk. ;) Best, Matt