Listing all the lines that contain certain tags

Hi

Is there a way to list the lines that contain a certain tag? I have tags in some notes, knowing which files contain that tag is not that useful toi me, it would be more helpful if I can list the lines that has that actual tag.

For example I might have

I am going to write about running. #write

This might be in a note that has many other irrrelavant lines but I would be interested in listing all the lines that has #write tag

I think dataview can do this, just that my knowledge of it is vert limited.

thanks.

I would use an embedded search query for this; give it a try to see if the results are enough for you. Scroll further up on the same linked page for your search options. e.g.

```query
tag: write
```

or

```query
line: #write
```

1 Like

Thanks, that is almost there for me, except the internal links looks a bit uggly with extended text view instead of rendered markdown version but this is a good start.

this is a link shows up as [this is a link](www.yahoo.com) in th resulting query line

I am guessing that this is not possible with dataview then?

I’m a fan of the beta (needs to be installed manually or via BRAT) plugin Query Control, which can render Markdown in search results among other things.


Dataview works with metadata (mostly), not really the content of your notes. e.g. having Dataview produce a list of notes where #write shows up is easy; where the tag shows up in the note itself is a different matter. Search and embedded search/queries are great for that.

This topic seems to explain it well:

1 Like

@ariehen

Thanks for the replies, this works. Is there a way a command line version of this where I can run a query from some kind of command line to create regular outputs and convert them to static pages? So that I can put them in other vaults that won’t have these files to run the query over.

Thanks

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.