[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] A quick way to empty contents of entries?
From: |
Carsten Dominik |
Subject: |
Re: [O] A quick way to empty contents of entries? |
Date: |
Fri, 4 Nov 2011 08:55:53 +0100 |
On Nov 4, 2011, at 7:56 AM, gylns wrote:
> Hi, all
> I want to empty all my contents but leave only with the headlines and the
> properties, is there a fast way?
Make backup copies before you try this....
For one file:
perl -ne 'print if /^\*+ / or /^\s*:PROPERTIES:\s*$/../^\s*:END:\s*$/'
old.org > stripped.org
For a bunch of files, with .bak backup copies
perl -ni.bak -e 'print if /^\*+ / or /^\s*:PROPERTIES:\s*$/../^\s*:END:\s*$/'
*.org
HTH
- Carsten