From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Re: Tracking Tags ?? Date: Wed, 23 Jan 2019 13:57:16 -0800 Message-ID: <87a7jrhwar.fsf@geus3064linuxwsm.geus.dk> References: <87zhrrteo8.fsf@yandex.com> <87va2ftatl.fsf@yandex.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:47254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmQWU-0000vL-JY for emacs-orgmode@gnu.org; Wed, 23 Jan 2019 16:57:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gmQWS-00064j-Rm for emacs-orgmode@gnu.org; Wed, 23 Jan 2019 16:57:26 -0500 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:35292) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gmQWQ-0005sH-4D for emacs-orgmode@gnu.org; Wed, 23 Jan 2019 16:57:22 -0500 Received: by mail-pg1-x541.google.com with SMTP id s198so1691028pgs.2 for ; Wed, 23 Jan 2019 13:57:19 -0800 (PST) In-reply-to: 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" To: John Kitchin Cc: David Masterson , Colin Baxter , "emacs-orgmode@gnu.org" On 2019-01-23 at 12:22 -0800, John Kitchin wrote... > I see, that only finds files with the particular tag. I think the goal of > this is to get a list of all the tags, for use in completion, for example. I do not think grep is the right solution, but as an ugly hack it can find most of my tags rather easily. Tags are wrapped in "::" and at the end of the line, I think. Assuming that, then, grep -h -E -o "\:.*\:$" *.org | grep -v -E "PROPERTIES|CATEGORY|END|LOG|STYLE|REPEAT|ID|RESULTS" | tr ':' '\n' | sort | uniq -c | sort -n Gives all my tags sorted by usage (I don't use them much) plus a few stray words others... Since drawers are usually begin on the 1st column, or within the first few columns, an alternative to the negative grep could be "cat *.org | cut -c10- | ..." or some other method to skip the first few columns, rather than growing the negative grep list. -k.