Cool! I will try this too Thanks
Cheers, M > On May 30, 2020, at 6:23 PM, Diego Zamboni <di...@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 > <mdoy...@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