obsidian-text-expand
obsidian-text-expand copied to clipboard
[Feature Request] Get a specific line of a file?
Hi!
I would like to know if you can get as a search result a specific line of a note. At the moment the $line
argument returns the entire contents of the note, likewise, using $lines:10
returns the first 10 lines of the file. It would be helpful if you could get a specific line using something like $line:9:9
so that you get as result the line 9 of the file. I tend to take a lot of notes with dashes as points of interest and it would be great to be able to quickly access a specific line.
Thanks.
Hi @EhuddR. While you can't do that by sequences you can do that using eta template.
file:FILENAME
<% it.files.forEach(file => { %>
<%= file.content.split('\n')[8] %>
<% }) %>
But yeah... This might be useful feature for sequences.
Also, you can use $matchline
to get the line from search panel.
Thank you for the answer. So far I had tried to avoid the eta template because I am not very good at programming except for a bit of HTML, CSS and R. Maybe we need a little more documentation on how to use this template.
Anyone feel free to reopen the issue if there are still enough cases for this feature.