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.
I have a csv file that has a date/time column and a value column and a name column. think a check in check out register at a receptionists desk using one integer in the value column to denote ins and a different integer for outs, always the same 2 integers used.[IE 6 always denotes a check in and 8 always denotes a check out]. I need to be able to take every register for a certain name and determine how long they were there each time they were there. basically,
with a new column for each checkin - checkout cycle. a large part of my problem is that I am not familiar with any command line program that can interpret date/timestamps and I can't seem to think of a proper search string to find one.
Display the time and date specified in datestr instead of the current time and date. datestr can be in almost any common format. It can contain month names, time zones, `am' and `pm', `yesterday', `ago', `next', etc.
not sure how that will take 2 time stamps and give me the amount of time that took place between the two. sorry if I wasn't clear enough in my first post.
not sure how that will take 2 time stamps and give me the amount of time that took place between the two. sorry if I wasn't clear enough in my first post.
Suppose you had a fixed starting time, say sometime in 1970. If you used date to convert both dates to the seconds since that fixed time, then you could subtract the two, and that result should be the time between the two timestamps.
This may require some reading of info date as jim advised, as well as some experimentation, but could be rewarding ... cheers, makyo
sorry for the delay, not working over the weekend. yeah I backed up a step and found unix time in the original log file. I need it to show up next to my name that I don't know perl, python even less. they get recommended for every question I ask. I'm sure I'll have more questions when I get a little farther in to this.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.