Re: [O] A quick way to empty contents of entries?
Carsten Dominik carsten.domi...@gmail.com writes: 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? [...] For one file: perl -ne 'print if /^\*+ / or /^\s*:PROPERTIES:\s*$/../^\s*:END:\s*$/' old.org stripped.org Hmm... perl. Within emacs, that would be something like C- M-x keep-lines RET ^\*\|:PROPERTIES:\(.\|\n\)+?:END: (\n via C-q C-j) ... right? Memnon
[O] A quick way to empty contents of entries?
Hi, all I want to empty all my contents but leave only with the headlines and the properties, is there a fast way? Cheers, gylns
Re: [O] A quick way to empty contents of entries?
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
Re: [O] A quick way to empty contents of entries?
Carsten Dominik carsten.dominik at gmail.com writes: For one file: perl -ne 'print if /^\*+ / or /^\s*:PROPERTIES:\s*$/../^\s*:END:\s*$/' old.org stripped.org Thanks Carsten, It works!