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