emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Marvin M. Doyley" <mdoyley@ur.rochester.edu>
To: Diego Zamboni <diego@zzamboni.org>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Splitting large org file into smaller ones
Date: Sat, 30 May 2020 20:41:33 -0400	[thread overview]
Message-ID: <6AB1CB70-EDF4-4C6A-B42F-0941E930B600@ur.rochester.edu> (raw)
In-Reply-To: <CAGY83EfcGkBo3ex+LK3+iFNeu=mZ3VThaQfsJWckHMacK-Emqg@mail.gmail.com>

Cool! I will try this too

Thanks

Cheers,
M

> On May 30, 2020, at 6:23 PM, Diego Zamboni <diego@zzamboni.org> wrote:
> 
> Hi Marvin,
> 
> I replied to a similar question some time ago, here's my answer (with
> updated links since the files have changed in the meantime):
> 
> I do something similar in my ox-leanpub-book module [1], which exports
> each top-level heading to a different file. The general idea is to use
> =org-map-entries= to loop over the entire buffer [2]. The function you
> call can then check whether the current entry is a header at the level
> you want [3] and then export it to the corresponding file. The title
> can be used to deduct the filename [4].
> 
> I found that I had to mark the entire subtree before calling the
> export function [5], otherwise the headline was not getting included
> in the export.
> 
> I based my code originally on this blog post, which might be a simpler
> starting point:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__medium.com_-40lakshminp_publishing-2Da-2Dbook-2Dusing-2Dorg-2Dmode-2D9e817a56d144&d=DwIBaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=T41F_5QsIVBGYhPPUkgYHUp9iPHgs2rOCjs7rfKaTMU&m=249GZv4Zgx7zyEm64J3m2eEYuchXSdodRltw_gmrqlg&s=exfuDxb81D5anZ5KD-hCvUI4PRaQxsb812EaBW3b9p4&e= 
> - this code does not select the entire subtree before exporting, which
> means only the contents of the section is exported, but not the
> headline itself.
> 
> I wrote a simplified function which puts the above ideas together,
> feel free to use it:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__gist.github.com_zzamboni_2e6ac3c4f577249d98efb224d9d34488&d=DwIBaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=T41F_5QsIVBGYhPPUkgYHUp9iPHgs2rOCjs7rfKaTMU&m=249GZv4Zgx7zyEm64J3m2eEYuchXSdodRltw_gmrqlg&s=ARDFenWJJT9XTsBKAReDC6bDx9VwbP3ADCw3o-_hQbY&e= 
> 
> Hope this helps!
> --Diego
> 
> [1] https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_zzamboni_ox-2Dleanpub_tree_book-2Dand-2Dmarkua&d=DwIBaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=T41F_5QsIVBGYhPPUkgYHUp9iPHgs2rOCjs7rfKaTMU&m=249GZv4Zgx7zyEm64J3m2eEYuchXSdodRltw_gmrqlg&s=peXBLnzs1ABFnCABzVUsley3-VMFDR0_2oLF3TgiBPM&e= 
> [2] https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_zzamboni_ox-2Dleanpub_blob_f7ae0f86f517a321a5150e1c712554b12acf144b_ox-2Dleanpub-2Dbook.el-23L216-2DL217&d=DwIBaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=T41F_5QsIVBGYhPPUkgYHUp9iPHgs2rOCjs7rfKaTMU&m=249GZv4Zgx7zyEm64J3m2eEYuchXSdodRltw_gmrqlg&s=3K2q6g7FxxjjxKJZtqdsE5bpMFT6RTf3S4mmyldNdLw&e= 
> [3] https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_zzamboni_ox-2Dleanpub_blob_f7ae0f86f517a321a5150e1c712554b12acf144b_ox-2Dleanpub-2Dbook.el-23L145&d=DwIBaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=T41F_5QsIVBGYhPPUkgYHUp9iPHgs2rOCjs7rfKaTMU&m=249GZv4Zgx7zyEm64J3m2eEYuchXSdodRltw_gmrqlg&s=QOtk1D413Gju7Agm6zgbAMlIwww6e-UV1SZsjomzuZA&e= 
> [4] https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_zzamboni_ox-2Dleanpub_blob_f7ae0f86f517a321a5150e1c712554b12acf144b_ox-2Dleanpub-2Dbook.el-23L154-2DL158&d=DwIBaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=T41F_5QsIVBGYhPPUkgYHUp9iPHgs2rOCjs7rfKaTMU&m=249GZv4Zgx7zyEm64J3m2eEYuchXSdodRltw_gmrqlg&s=ynLKEu4CLjIJqR3y3zl2UMEkS_onMBSSb2TDwOaixt4&e= 
> [5] https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_zzamboni_ox-2Dleanpub_blob_f7ae0f86f517a321a5150e1c712554b12acf144b_ox-2Dleanpub-2Dbook.el-23L192&d=DwIBaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=T41F_5QsIVBGYhPPUkgYHUp9iPHgs2rOCjs7rfKaTMU&m=249GZv4Zgx7zyEm64J3m2eEYuchXSdodRltw_gmrqlg&s=quomDHaK1zPArr8wu5m8uwkgug6NZ6eDChE5VMZwrG4&e= 
> 
> On Sat, May 30, 2020 at 12:08 PM Marvin M. Doyley
> <mdoyley@ur.rochester.edu> wrote:
>> 
>> Hi there,
>> 
>> Is there an efficient way to split a large org file into smaller ones?
>> 
>> Lets say I have a master file with the following
>> 
>> 
>> * Notes
>> **  Candidate A
>> - Strong technical background
>> - High H-factor
>> - good funding
>> - More established investigator
>> - Huge startup need $$
>> 
>> **  Candidate B
>> - lower startup need
>> - signal processing
>> - young investigator
>> 
>> 
>> How do I export the subtree to separate org files, say
>> 
>> - Candidate-a.org
>> - Candidate-b.org
>> 
>> 
>> Thanks
>> 
>> M



  reply	other threads:[~2020-05-31  0:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30  9:51 Splitting large org file into smaller ones Marvin M. Doyley
2020-05-30 13:13 ` Marcin Borkowski
2020-05-31  0:40   ` Marvin M. Doyley
2020-05-30 14:37 ` Tim Visher
2020-05-30 15:36 ` William Denton
2020-05-30 18:18   ` Julius Dittmar
2020-05-31  0:42   ` Marvin M. Doyley
2020-05-30 22:23 ` Diego Zamboni
2020-05-31  0:41   ` Marvin M. Doyley [this message]
2020-05-31 15:29 ` John Kitchin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6AB1CB70-EDF4-4C6A-B42F-0941E930B600@ur.rochester.edu \
    --to=mdoyley@ur.rochester.edu \
    --cc=diego@zzamboni.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).