Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   Simple Math, posted by mike cianci on Mon Apr 13 07:26:39 2009 
    icon2.gif   Re: Simple Math, posted by Stefan Ritt on Tue Apr 14 08:30:42 2009 
       icon2.gif   Re: Simple Math, posted by Erik Iverson on Tue Apr 14 17:57:56 2009 
Message ID: 66310     Entry time: Tue Apr 14 17:57:56 2009     In reply to: 66304
Icon: Reply  Author: Erik Iverson  Author Email: eiverson@ornl.gov 
Category: Question  OS: Windows  ELOG Version: 2.7.5-2187 
Subject: Re: Simple Math 

Stefan Ritt wrote:

 

mike cianci wrote:

Sorry to bother you. I could see in past Forum entries that the question of  "Simple Math" has come up before, although the answers were not all that simple.

Can you do simple math (i.e. attribute A + attribute B = attribute C) in ELOG ?

Thank you for putting up with my questions.

Mike

 

No, you can't. The only way is to export a logbook to CSV, then import it in a spreadsheet program, then do the math there. 

 You can pass numerical attributes to an external command via "Execute new =...".  This external command can then do the math and pass the result _back_ to the logbook either as a new entry or as an edit with the command-line client "elog".

For example, given a new entry with (numerical) attributes A and B, if you have

Execute new = add_them.pl $A $B $message id

in your elog.cfg file, then $A and $B will be passed to the add_them.pl perl script.  Now have the perl script (or bc, or whatever you want to use) do the appropriate math and submit the result.  For example, your perl script might include

$C=$A+$B

$D=$A*$B

elog -a C=$C ... -e "$message id" "Sum as edit"

elog -a D=$D ... "Product as new entry"

 

ELOG V3.1.5-fe60aaf