Thursday, 8 April 2021

sort text found in any input textbox

I am using "sort table" bookmarklet that works very well.

https://www.squarefree.com/bookmarklets/pagedata.html

I can use it on any page where there is a table. For e.g.

https://mr.wikipedia.org/wiki/%E0%A4%B5%E0%A4%BF%E0%A4%95%E0%A4%BF%E0%A4%AA%E0%A5%80%E0%A4%A1%E0%A4%BF%E0%A4%AF%E0%A4%BE:%E0%A4%B6%E0%A5%81%E0%A4%A6%E0%A5%8D%E0%A4%A7%E0%A4%B2%E0%A5%87%E0%A4%96%E0%A4%A8_%E0%A4%9A%E0%A4%BF%E0%A4%95%E0%A4%BF%E0%A4%A4%E0%A5%8D%E0%A4%B8%E0%A4%BE_%E0%A4%B8%E0%A5%81%E0%A4%A7%E0%A4%BE%E0%A4%B0%E0%A4%A3%E0%A4%BE_%E0%A4%AA%E0%A5%8D%E0%A4%B0%E0%A4%95%E0%A4%B2%E0%A5%8D%E0%A4%AA

But is it possible to sort the text in the next section that does not have table properties? For e.g. how do I sort the words in the section?

===इंग्लिश शब्दास मराठी शब्द सूचना===

Is it possible to re-write the same bookmarklet to sort text in any input textbox?


Update:

I am using decorate-sort-undecorate idiom

awk '/=/ {c++} {print c+1, $0}' file.txt | sort -n | cut -d' ' -f2- | sed '/^$/d'

It will look for "equal to" sign and number all the lines in that particular section to be later sorted on. This is working as expected. But I need to copy-paste the text from wiki to linux prompt. I guess bookmarklet will be quicker. The page mentioned above is just an example. I need to be able to sort the text typed in any text area of the browser. The relevant wiki page does not mention how to do this in javascript.

https://en.wikipedia.org/wiki/Schwartzian_transform



from sort text found in any input textbox

No comments:

Post a Comment