emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] : Search for missing :END:


From: Olaf Dietsche
Subject: Re: [O] : Search for missing :END:
Date: Tue, 22 Nov 2011 09:46:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Nick Dokos <address@hidden> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]