[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 16:03:02 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Matt Price <address@hidden> 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