[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] refile whole files as headings?

From: Nick Dokos
Subject: Re: [O] refile whole files as headings?
Date: Tue, 01 Sep 2015 23:05:38 -0400
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Matt Price <address@hidden> 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]