From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Dietsche Subject: Re: : Search for missing :END: Date: Tue, 22 Nov 2011 09:46:33 +0100 Message-ID: <87d3ckczo6.fsf@rat.lan> References: <0vvcqdxqf0.fsf@gmail.com> <6557.1321911502@alphaville.americas.hpqcorp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:48731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSm0A-0008MW-IH for emacs-orgmode@gnu.org; Tue, 22 Nov 2011 03:46:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSm04-0000Bx-M4 for emacs-orgmode@gnu.org; Tue, 22 Nov 2011 03:46:50 -0500 Received: from www85.your-server.de ([213.133.104.85]:38109) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSm04-0000Bk-HT for emacs-orgmode@gnu.org; Tue, 22 Nov 2011 03:46:44 -0500 In-Reply-To: <6557.1321911502@alphaville.americas.hpqcorp.net> (Nick Dokos's message of "Mon, 21 Nov 2011 16:38:22 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: Markus Heller , emacs-orgmode@gnu.org Nick Dokos writes: [snip] > But assuming that you are getting some error from org, you don't know > where the problem is and you are trying to find it, it will be simpler > to just use egrep: > > grep -E -n ':PROPERTIES:|:END:' foo.org > > will filter out the relevant lines, so all you have to do is scan the > output by eye and spot any irregularity (consecutive :PROPERTIES: or > consecutive :END: lines). Even if you have hundreds of them, that's > *easy* for humans to do.[fn:2] > > Or, if you prefer, you can write trivial validation programs to operate > on the output, e.g.: > > grep -E -n ':PROPERTIES:|:END:' foo.org | tee foo.out | grep PROP | wc -l > grep END foo.out | wc -l > > (the counts 'd better be the same). Since you might have other drawers as well (LOGBOOK, CLOCK), the counts need not be the same. Regards, Olaf NB: At least GNU grep knows how to search for multiple regexps: $ grep -e :PROPERTIES: -e :END: foo.org So, no need for egrep here.