[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: Merging .org files
From: |
Pere Quintana Seguí |
Subject: |
[Orgmode] Re: Merging .org files |
Date: |
Mon, 31 Jan 2011 16:18:06 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); ca; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 |
Al 30/01/11 22:51, En/na Matt Lundin ha escrit:
> Pere Quintana Seguí <address@hidden> 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.
So, maybe my initial assumption is wrong.
Has anybody run some experiments to check if it is better to have a
small number of big files or many small files?
> 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 = "/tmp/merged.org";
>
> open NEWFILE, ">", $mergefile
> 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. ;)
Great, thank you!
Pere
--
Dr. Pere Quintana Seguí
Observatori de l'Ebre (Universitat Ramon Llull - CSIC)
Horta Alta, 38. 43520 Roquetes (Tarragona), Spain.
T. (+34) 977 500 511 - F. (+34) 977 504 660
http://www.obsebre.es - http://pere.quintanasegui.com
GnuPG:2CAB4330
http://pere.quintanasegui.com/coses/key-transition.txt
signature.asc
Description: OpenPGP digital signature