A shell script:Matt Price <moptop99@gmail.com> 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
--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