Copy desered text from clipboard and store in a structured history
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Copy desered text from clipboard and store in a structured history
Okay so I want to be able to copy text from clipboard, I know words will always be the same at the start of the desired text I wish to extract from the clipboard, and I know what the end text will be. I want to extract this text and everything in-between it and save it in a history.
Can anyone give me tips or an example of how this might be done? I wan t to do this, if at all possible, using the tcl programing language, but I'm sure that if someone gives me an example say in python or something like this I could translate it over.
Just open a file, and in a while loop (while file is not eof) just use getline and set delimiters (eg the first and last line) in a if loop inside it just put contune, that (else) do something witht he rest of the data...
The easiest way to access the clipboard is probably by executing and reading output from an existing program that can do it, eg xclip. Else you would need to look at xlib or xcb bindings.
The easiest way to access the clipboard is probably by executing and reading output from an existing program that can do it, eg xclip. Else you would need to look at xlib or xcb bindings.
No its not, but the same princiles apply, open the data for reading and loop through it between 1 defined delimitor and another and in the process either map that data to something else or store it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.