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

Reply via email to