Hello.
First, many thanks for this file explorer, which I recently discovered and chose to purchase, because for me it really clarifies file exploration, and has a lot of handy options.
My question concerns plain text .md or .txt files, the content of which includes keywords, commonly identified by the character hash (#) attached to keywords (#keyword).
I would like xyplorer to be able to recognize these keywords inside my .md or .txt files, and for them to be automatically added to xyplorer's keyword database (and viewed in the respective column).
Is there such a script?
I searched the forum about this question, but couldn't find it.
I am a "non-geek" user, and am a bit confused by the complexity of the language's script.
I hope my message is intelligible (I am French speaking) ...
keywords recognition embedded in plain text files
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: keywords recognition embedded in plain text files
All keywords should be shown in a single column?
What do you do if a .md file has 30 of them (just for example)? The column wouldn't probably wide enough...
What do you do if a .md file has 30 of them (just for example)? The column wouldn't probably wide enough...
One of my scripts helped you out? Please donate via Paypal
-
HugoBil
- Posts: 6
- Joined: 11 Oct 2020 15:25
Re: keywords recognition embedded in plain text files
Rarely do my files exceed 5 keywords.
In the event that a file has a large number of keywords (30!) my problem is not so much to be able to visualize them all, but that I use those keywords as a means of finding files. As I do with XY, when I separate several keywords with a comma, in order to list all the files that match the combination of various keywords.
In the keywords native column of XYplorer the keywords, separated by a comma, fit in a single row. They are arranged in alphabetical order, and since the sorting depends on that order, I don't use the column to sort the files. Incidentally, I use an additional column that has only one keyword per file, the keyword "main" or "topic", and I sort the files according to. The XY keywords native column, I mainly use it to add keywords to files, which will then help me find files that are not separated into directories.
Having expressed this, I now consider the vagueness of my first message ...
For my .md or .txt files, the keywords I add to the native column of XY are the same as the keywords contained in these files in the form #keyword. Having a lot of files it is tedious to get it done.
I'm thinking of a script that adds a line to the context menu (right click) of the keywords column of XY. This line would for example be "add the keywords contained in the selected file". In my case, the script should be able to read the contents of a file, extract the keywords identified by the character #, and append them (stripped of # and separated by commas) to the XYplorer keywords…?
I do not know if this is possible, or even if it may apply to other users.
In the event that a file has a large number of keywords (30!) my problem is not so much to be able to visualize them all, but that I use those keywords as a means of finding files. As I do with XY, when I separate several keywords with a comma, in order to list all the files that match the combination of various keywords.
In the keywords native column of XYplorer the keywords, separated by a comma, fit in a single row. They are arranged in alphabetical order, and since the sorting depends on that order, I don't use the column to sort the files. Incidentally, I use an additional column that has only one keyword per file, the keyword "main" or "topic", and I sort the files according to. The XY keywords native column, I mainly use it to add keywords to files, which will then help me find files that are not separated into directories.
Having expressed this, I now consider the vagueness of my first message ...
For my .md or .txt files, the keywords I add to the native column of XY are the same as the keywords contained in these files in the form #keyword. Having a lot of files it is tedious to get it done.
I'm thinking of a script that adds a line to the context menu (right click) of the keywords column of XY. This line would for example be "add the keywords contained in the selected file". In my case, the script should be able to read the contents of a file, extract the keywords identified by the character #, and append them (stripped of # and separated by commas) to the XYplorer keywords…?
I do not know if this is possible, or even if it may apply to other users.
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: keywords recognition embedded in plain text files
Sure it's possible.
That's not possible. So you need to put that script on a button, as a user defined command (which could be invoked via hotkey afterwards), catalog, ... you choose...that adds a line to the context menu (right click) of the keywords column of XY
To see the attached files, you need to log into the forum.
One of my scripts helped you out? Please donate via Paypal
-
HugoBil
- Posts: 6
- Joined: 11 Oct 2020 15:25
Re: keywords recognition embedded in plain text files
Thank you for your time and for writing this script.
I ran the script step by step, to see if I can figure out why it isn't working on my files.
I now know that for its effectiveness, my keywords must be one per line (and at the start of the line):
#keyword1
#keyword2
...
#keyword3
But in my files the keywords are written in one line:
#keyword1 #keyword2 #keyword3…
And in this case the script only captures the first keyword of the line (keyword1).
I have tried in vain to modify the script, especially the <crlf> on line 5 and 10, but this does not change its behavior.
I am therefore forced to modify my files upstream (replace the space that separates each of the keywords with a CRLF in order to form a list rather than a line) or once again rely on your skills so that the script can capture all the keywords written on one line.
I apologize if this request seems to exaggerate, I don't have the knowledge to know if it is difficult to achieve.
I ran the script step by step, to see if I can figure out why it isn't working on my files.
I now know that for its effectiveness, my keywords must be one per line (and at the start of the line):
#keyword1
#keyword2
...
#keyword3
But in my files the keywords are written in one line:
#keyword1 #keyword2 #keyword3…
And in this case the script only captures the first keyword of the line (keyword1).
I have tried in vain to modify the script, especially the <crlf> on line 5 and 10, but this does not change its behavior.
I am therefore forced to modify my files upstream (replace the space that separates each of the keywords with a CRLF in order to form a list rather than a line) or once again rely on your skills so that the script can capture all the keywords written on one line.
I apologize if this request seems to exaggerate, I don't have the knowledge to know if it is difficult to achieve.
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: keywords recognition embedded in plain text files
Replace
(^|\b)#[a-z0-9]+ with #[a-z0-9]+One of my scripts helped you out? Please donate via Paypal
-
HugoBil
- Posts: 6
- Joined: 11 Oct 2020 15:25
Re: keywords recognition embedded in plain text files
Big thank you it works! That's great!
XYplorer Beta Club