From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: refile whole files as headings? Date: Tue, 01 Sep 2015 16:03:02 -0400 Message-ID: <87pp21q555.fsf@alphaville.usersys.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWrmA-0003t2-BH for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 16:03:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWrm7-0002N6-K3 for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 16:03:26 -0400 Received: from plane.gmane.org ([80.91.229.3]:60522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWrm7-0002Mb-EN for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 16:03:23 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZWrm4-0004db-L8 for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 22:03:20 +0200 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 Sep 2015 22:03:20 +0200 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 Sep 2015 22:03:20 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Matt Price writes: > I am reorganizing my courses, consolidating many short files into longer ones. So, for instance, I have > a directory like: > > ✗ ls Assignments > > ClassProjectGuidelines.org > course-blog.org > essay-assignment.org > ProjectProposal.org > STA-01-CSS.org > STA-02-wordpress-themes.org > STA-03-Foundation.org > STA-04-maps.org > > I'd like to turn this into Assignments.org, with a structure like this: > > * ClassProjectGuidelines.org > * course-blog.org > * essay-assignment.org > * ProjectProposal.org > * STA-01-CSS.org > * STA-02-wordpress-themes.org > * STA-03-Foundation.org > * STA-04-maps.org > > It's sort of the reverse of Marcin's one-to-many export issue as described in another thread.  Best ways > to accomplish this? thx, > m A shell script: --8<---------------cut here---------------start------------->8--- cd Assignments for f in *.org; do echo "* $f" cat $f done > Assignments.org --8<---------------cut here---------------end--------------->8--- If you need to change the levels of the headings in the files, use a sed script instead of cat: sed '/^\*/s/&/**/' $f Nick