* A quick way to empty contents of entries? @ 2011-11-04 6:56 gylns 2011-11-04 7:55 ` Carsten Dominik 0 siblings, 1 reply; 4+ messages in thread From: gylns @ 2011-11-04 6:56 UTC (permalink / raw) To: emacs-orgmode 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: A quick way to empty contents of entries? 2011-11-04 6:56 A quick way to empty contents of entries? gylns @ 2011-11-04 7:55 ` Carsten Dominik 2011-11-04 8:56 ` gylns 2011-11-23 17:11 ` Memnon Anon 0 siblings, 2 replies; 4+ messages in thread From: Carsten Dominik @ 2011-11-04 7:55 UTC (permalink / raw) To: gylns; +Cc: emacs-orgmode 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: A quick way to empty contents of entries? 2011-11-04 7:55 ` Carsten Dominik @ 2011-11-04 8:56 ` gylns 2011-11-23 17:11 ` Memnon Anon 1 sibling, 0 replies; 4+ messages in thread From: gylns @ 2011-11-04 8:56 UTC (permalink / raw) To: emacs-orgmode 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! ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: A quick way to empty contents of entries? 2011-11-04 7:55 ` Carsten Dominik 2011-11-04 8:56 ` gylns @ 2011-11-23 17:11 ` Memnon Anon 1 sibling, 0 replies; 4+ messages in thread From: Memnon Anon @ 2011-11-23 17:11 UTC (permalink / raw) To: emacs-orgmode Carsten Dominik <carsten.dominik@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 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-11-23 17:12 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-11-04 6:56 A quick way to empty contents of entries? gylns 2011-11-04 7:55 ` Carsten Dominik 2011-11-04 8:56 ` gylns 2011-11-23 17:11 ` Memnon Anon
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).