From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id DIhUJRbd0l6AFwAA0tVLHw (envelope-from ) for ; Sat, 30 May 2020 22:24:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id aB69IBbd0l6cPgAA1q6Kng (envelope-from ) for ; Sat, 30 May 2020 22:24:22 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 76ABA9402A2 for ; Sat, 30 May 2020 22:24:20 +0000 (UTC) Received: from localhost ([::1]:46852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jf9tp-0005Hl-Tc for larch@yhetil.org; Sat, 30 May 2020 18:24:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jf9tC-0005Hf-9S for emacs-orgmode@gnu.org; Sat, 30 May 2020 18:23:38 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:43552) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jf9tB-0007eS-7G for emacs-orgmode@gnu.org; Sat, 30 May 2020 18:23:38 -0400 Received: by mail-ej1-x635.google.com with SMTP id a2so5602993ejb.10 for ; Sat, 30 May 2020 15:23:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zzamboni-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=A9+CzG+stGB/egsEN37A2hmJZDrU3pVOygvhf9fjzgA=; b=PFCjpDJYyi+ZbRGq7hkGKhPabqjImtPVVGP3oWpFGYDy0W+zjdAU6EyjRphtZYOB2G cQJNVMlinEsHr4Mnax4hoR4rHXPmQeUHCs64yPgDjIGoDCaVI+WDm3/V5xt2rzR/qNtW 1E8UiAmyDGFrecuP0xJDMA7ZA4jpVBOe12DAqOehog4z1q/WSEU6LhVwQtm0ux79UReb 0pc1cWf5BYdt+t7o23xLtf4S7naBtGf3qdeNUTuvtvXve7V4+oc1tAlnFszKuLLSbggP 4nfyTLmSW2YwAflZ9ujApevn8X1H956eiqyCQnulr9DnpjJDddGuLYqo1e12yGEGpREA Rh5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=A9+CzG+stGB/egsEN37A2hmJZDrU3pVOygvhf9fjzgA=; b=XM0z1gftSNAvaWiX9kgwfKg7NWD9taS2hfjoWPeRKYQjDFHT27Vj1MOc0HMW4HzkOu xHZeuNIYIgxLfNZitsRX9FwtkZ+1sXkZTpghWleeI327pY3YlFcWs1krEzYkR26q6fHq aJR4JBXIbpDUpPEVDVOvUuzYll2OGRVisaWaSB5zOjVWZZjxXYhoUSkxI5/8xqPjdsk/ Nk3N2VoUSUY4ddrz8EAt1dRZMnw78GvPWI9WsheRlvGSMh3GA3764CKmOwEF0UBls/w/ pJJm9iQ4iLbBi5X5KNAXoWEUsh+addi6kP2DJAr6b4vtemx3LlfwIDZFbjpbPcDnSLxE ipwQ== X-Gm-Message-State: AOAM532HZoQ3JMbR/EyKffu8ttQVVy7p9nS/O85KY0kaJ3HNlqC42sgq +/pXV2OgT/g5Qw/KrGpuWcIu+pYEIcPmyx12IDmT+A== X-Google-Smtp-Source: ABdhPJzpWMtvhwwVZpmS/ZDgGA+LdvuGnAMUuVXpvC4kIG3jtKPFHXlRsskJHa/4xfpdNotGbrS/r6d7DzjQ7E2RzqA= X-Received: by 2002:a17:906:dbef:: with SMTP id yd15mr13249970ejb.5.1590877415017; Sat, 30 May 2020 15:23:35 -0700 (PDT) MIME-Version: 1.0 References: <64119DDD-42BD-47AC-9EB6-DD25FE58BB37@ur.rochester.edu> In-Reply-To: <64119DDD-42BD-47AC-9EB6-DD25FE58BB37@ur.rochester.edu> From: Diego Zamboni Date: Sun, 31 May 2020 00:23:24 +0200 Message-ID: Subject: Re: Splitting large org file into smaller ones To: "Marvin M. Doyley" Content-Type: text/plain; charset="UTF-8" Received-SPF: none client-ip=2a00:1450:4864:20::635; envelope-from=diego@zzamboni.org; helo=mail-ej1-x635.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=zzamboni-org.20150623.gappssmtp.com header.s=20150623 header.b=PFCjpDJY; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.21 X-TUID: wd+Nl+oEEftn 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://medium.com/@lakshminp/publishing-a-book-using-org-mode-9e817a56d144 - 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://gist.github.com/zzamboni/2e6ac3c4f577249d98efb224d9d34488 Hope this helps! --Diego [1] https://github.com/zzamboni/ox-leanpub/tree/book-and-markua [2] https://github.com/zzamboni/ox-leanpub/blob/f7ae0f86f517a321a5150e1c712554b12acf144b/ox-leanpub-book.el#L216-L217 [3] https://github.com/zzamboni/ox-leanpub/blob/f7ae0f86f517a321a5150e1c712554b12acf144b/ox-leanpub-book.el#L145 [4] https://github.com/zzamboni/ox-leanpub/blob/f7ae0f86f517a321a5150e1c712554b12acf144b/ox-leanpub-book.el#L154-L158 [5] https://github.com/zzamboni/ox-leanpub/blob/f7ae0f86f517a321a5150e1c712554b12acf144b/ox-leanpub-book.el#L192 On Sat, May 30, 2020 at 12:08 PM Marvin M. Doyley 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