From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: refile whole files as headings? Date: Tue, 1 Sep 2015 12:16:02 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1140ff12cc2827051eb1dd2c Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWoFH-0002hq-Bp for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 12:17:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWoFE-0004Nq-Hf for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 12:17:15 -0400 Received: from mail-io0-f176.google.com ([209.85.223.176]:36033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWoFE-0003mo-9U for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 12:17:12 -0400 Received: by ioii196 with SMTP id i196so6850233ioi.3 for ; Tue, 01 Sep 2015 09:16:04 -0700 (PDT) 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: Org Mode --001a1140ff12cc2827051eb1dd2c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I am reorganizing my courses, consolidating many short files into longer ones. So, for instance, I have a directory like: =E2=9C=97 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 --001a1140ff12cc2827051eb1dd2c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I am reorganizing my courses, consolidating= many short files into longer ones. So, for instance, I have a directory li= ke:

=E2=9C=97 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, wi= th a structure like this:

* ClassProjectGuidelines.org
* course-blog.org
* essay-assignment.org
* ProjectProposal.org
* ST= A-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.=C2=A0 Best ways = to accomplish this? thx,
m

--001a1140ff12cc2827051eb1dd2c-- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: refile whole files as headings? Date: Tue, 1 Sep 2015 21:18:32 -0400 Message-ID: References: <87pp21q555.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b10c975e9db98051eb971db Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWwh9-00020N-G2 for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 21:18:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWwh7-0004zD-S4 for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 21:18:35 -0400 Received: from mail-ig0-x22e.google.com ([2607:f8b0:4001:c05::22e]:33750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWwh7-0004z7-ED for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 21:18:33 -0400 Received: by igbkq10 with SMTP id kq10so14711280igb.0 for ; Tue, 01 Sep 2015 18:18:32 -0700 (PDT) In-Reply-To: <87pp21q555.fsf@alphaville.usersys.redhat.com> 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: Nick Dokos Cc: Org Mode --047d7b10c975e9db98051eb971db Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thank you so much Nick! I am terrible with sed and with pipes, and ended up having two problems when trying to use this code with sed; I ended up modifying it to the following: for f in *.org; do echo "* $f" >> allofem.org # cat $f cat $f | sed 's/^\*/**/' >> allofem.org done not as elegant looking as yours, but it worked for me. very helpful and much appreciated! m On Tue, Sep 1, 2015 at 4:03 PM, Nick Dokos wrote: > Matt Price writes: > > > I am reorganizing my courses, consolidating many short files into longe= r > ones. So, for instance, I have > > a directory like: > > > > =E2=9C=97 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 > > > --047d7b10c975e9db98051eb971db Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thank you so much Nick!

I= am terrible with sed and with pipes, and ended up having two problems when= trying to use this code with sed; I ended up modifying it to the following= :

for f in *.org; do
=C2=A0=C2=A0=C2=A0 echo "* $f" >= ;> allofem.org
=C2=A0=C2=A0=C2=A0 = # cat $f
=C2=A0=C2=A0=C2=A0 cat $f | sed 's/^\*/**/' >> allofem.org
done

not as el= egant looking as yours, but it worked for me.

very helpful and= much appreciated!
m


<= div class=3D"gmail_quote">On Tue, Sep 1, 2015 at 4:03 PM, Nick Dokos <ndoko= s@gmail.com> wrote:
Matt Price <moptop99@gmail.com> writes:

> I am reorganizing my courses, consolidating many short files into long= er ones. So, for instance, I have
> a directory like:
>
> =E2=9C=97 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.=C2=A0 Best ways
> to accomplish this? thx,
> m

A shell script:

--8<---------------cut here---------------start------------->8---
cd Assignments
for f in *.org; do
=C2=A0 echo "* $f"
=C2=A0 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:

=C2=A0 =C2=A0sed '/^\*/s/&/**/' $f

Nick



--047d7b10c975e9db98051eb971db-- 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 23:05:38 -0400 Message-ID: <87pp214j25.fsf@pierrot.dokosmarshall.org> References: <87pp21q555.fsf@alphaville.usersys.redhat.com> 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]:39627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWyN2-0001RU-5A for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 23:05:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWyMy-0006t8-1Y for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 23:05:55 -0400 Received: from plane.gmane.org ([80.91.229.3]:54823) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWyMx-0006t0-Qx for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 23:05:51 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZWyMw-0001e8-3p for emacs-orgmode@gnu.org; Wed, 02 Sep 2015 05:05:50 +0200 Received: from pool-108-20-41-232.bstnma.fios.verizon.net ([108.20.41.232]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Sep 2015 05:05:50 +0200 Received: from ndokos by pool-108-20-41-232.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Sep 2015 05:05:50 +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: > Thank you so much Nick! > > I am terrible with sed and with pipes, and ended up having two problems when trying to use this code with sed; I ended up modifying it to the following: > > for f in *.org; do >     echo "* $f" >> allofem.org >     # cat $f >     cat $f | sed 's/^\*/**/' >> allofem.org > done > > not as elegant looking as yours, but it worked for me. > Except that I screwed up: the sed invocations was wrong: --8<---------------cut here---------------start------------->8--- cd Assignments for f in *.org; do echo "\* $f" sed '/^\*/s//**/' $f done > Assignments.org --8<---------------cut here---------------end--------------->8--- should work (maybe I should try it out... nah, what could go wrong?) > If you need to change the levels of the headings in the files, > use a sed script instead of cat: > >    sed '/^\*/s/&/**/' $f > Sorry about that. -- Nick