Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
I need a way to pin a unique id to every line in a LibreOfficeCalc sheet. A simple date file (yyyy_mm_dd) or a four place number (or,better, both) would be ideal, but it needs to stick with the data in the line it is in even through sorting procedures, or when a new line is added. And it should be added automatically when a line is added. And it would help if it could change when any cell in the line is changed.
I have searched the internet for an answer, and find nothing that I can understand, or even that I can be sure applies to the problem.
One way to get a unique number that changes when the line changes would be to do a hash of the line, MD5 or SHA256 or something. However, LibreOffice won't have a built-in hashing function until the underlying storage format (ODF 1.2) specifies it in the standard. It won't hurt to request it in the LibreOffice bug tracker or to add your use-case there if there is already a bug filed.
Here and how, the way to do a hash looks to be writing a macro. I haven't needed macros since the 1990's so I can't do much more than say it's possible to write LibreOffice macros in Java, Python, or Javascript. You'll have to find a tutorial on that.
Depending on how you do your macro, you might want an IF() combined with an ISBLANK() to check if an important column is filled and only then show your counter.
Thanks, Turboapitalist. I sort of thought of that, but had no idea how to do it, or search for it. Now, I can perhaps use your terminology to at least check it out. (By the way I love your moniker).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.