LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 12-25-2016, 11:03 PM   #1
littlejoe5
Member
 
Registered: Aug 2006
Location: Arizona
Distribution: ubuntu dirivatives mostly Mate
Posts: 260

Rep: Reputation: 19
I need an id or date column in LOCalc


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.
 
Old 12-26-2016, 03:03 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,309
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
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.
 
Old 12-26-2016, 09:26 PM   #3
littlejoe5
Member
 
Registered: Aug 2006
Location: Arizona
Distribution: ubuntu dirivatives mostly Mate
Posts: 260

Original Poster
Rep: Reputation: 19
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).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to sort file with date column? santosh0782 Linux - Newbie 11 05-28-2014 11:37 PM
[SOLVED] replace the nth column date as MM/DD/YYYY anshaa Linux - Newbie 1 08-13-2012 04:25 AM
LXer: How to change Thunderbird's date format in Date column LXer Syndicated Linux News 0 07-18-2012 02:11 AM
nautilus: changing the appearance of the 'date modified' column? apeekaboo Linux - Software 1 09-23-2011 03:36 AM
Open Office year-to-date column Stragonian Linux - Software 1 04-13-2010 12:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration