Sponsored Content
Full Discussion: taking the Log2 values
Top Forums Shell Programming and Scripting taking the Log2 values Post 302340896 by kylle345 on Tuesday 4th of August 2009 03:40:24 PM
Old 08-04-2009
taking the Log2 values

Hi,

I am able to take the log value for the third column of a file using the script below. But I want to take the log2 (not the log). How would I write that?

thanks

awk 'BEGIN {OFS="\t"} {print $1, $2, log ($3)}'
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Converting Binary decimal coded values to Ascii Values

Hi All, Is there any command which can convert binary decimal coded values to ascii values... i have bcd values like below оооооооооооо0о-- -v - Pls suggest a way to convert this. Thanks, Deepti.Gaur (3 Replies)
Discussion started by: gaur.deepti
3 Replies

2. UNIX for Dummies Questions & Answers

Please help me in taking the values from a file

i have a script, whcih takes values from a file and assign it to one variable. this text value contains name of few object. value contains line by lie. i.e. one after another. when i am assaign the value of this text file to a variable, it accept the value as one liner instead of one by one.... (3 Replies)
Discussion started by: jin
3 Replies

3. Shell Programming and Scripting

How to pick values from column based on key values by usin AWK

Dear Guyz:) I have 2 different input files like this. I would like to pick the values or letters from the inputfile2 based on inputfile1 keys (A,F,N,X,Z). I have done similar task by using awk but in that case the inputfiles are similar like in inputfile2 (all keys in 1st column and values in... (16 Replies)
Discussion started by: repinementer
16 Replies

4. Shell Programming and Scripting

Compare values in two files. For matching rows print corresponding values from File 1 in File2.

- I have two files (File 1 and File 2) and the contents of the files are mentioned below. - I am trying to compare the values of Column1 of File1 with Column1 of File2. If a match is found, print the corresponding value from Column2 of File1 in Column5 of File2. - I tried to modify and use... (10 Replies)
Discussion started by: Santoshbn
10 Replies

5. Shell Programming and Scripting

Taking sum up all values inside the file

Hi, Taking sum up all values inside the file by using the below command: paste -sd+ filenmae | bc Getting some error like "0705-001: building space exceeded on line1 stdin" The original data looks like SPACE SPACE SPACE 0.123 JOBNAME1 SPACE SPACE 20.325 JOBNAME2 SPACE SPACE... (2 Replies)
Discussion started by: NareshN
2 Replies

6. Shell Programming and Scripting

Converting odd values to even values(or vice-versa) located in a column

Hello All, I have a below data in a .csv file where all rows where col1 is A, col2 is odd numbers, similarly even numbers for all rows where col1 is B. Note that my data has some other columns(not shown here) too (around 100) after col2. Tool,Data A,1 A,3 A,5 .... so on B,2 B,4 .... ... (4 Replies)
Discussion started by: ks_reddy
4 Replies

7. Shell Programming and Scripting

Query the table and return values to shell script and search result values from another files.

Hi, I need a shell script, which would search the result values from another files. 1)execute " select column1 from table_name" query on the table. 2)Based on the result, need to be grep from .wft files. could please explain about this.Below is the way i am using. #!/bin/sh... (4 Replies)
Discussion started by: Rami Reddy
4 Replies

8. Shell Programming and Scripting

Read record from the text file contain multiple separated values & assign those values to variables

I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables. I need to read this file which is an input to my script Config.txt file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies

9. Shell Programming and Scripting

awk file to read values from Db2 table replacing hard coded values

Hi, I want to replace a chain of if-else statement in an old AWK file with values from Db2 table or CSV file. The part of code is below... if (start_new_rec=="true"){ exclude_user="false"; user=toupper($6); match(user, "XXXXX."); if (RSTART ==2 ) { ... (9 Replies)
Discussion started by: asandy1234
9 Replies

10. Shell Programming and Scripting

Taking key values from one file and extracting values from another file

Hi, I have two files with values in both. File1: cat 2 3 dog 4 5 elephant 6 7 camel 2 3 File2: ----+--gkf;ajf= ---+---- +----- cat -------=----+ 3 | 4 ----- dog ------++-- 5 | 9 ----++-- elephant | 5 | 7 ---++ camel ------ ++++_---- || 8 | 9 I want the final file as: cat 4... (1 Reply)
Discussion started by: npatwardhan
1 Replies
LOG(3)							   BSD Library Functions Manual 						    LOG(3)

NAME
log, logf, log10, log10f, log1p, log1pf log2, log2f, -- logarithm functions LIBRARY
Math Library (libm, -lm) SYNOPSIS
#include <math.h> double log(double x); float logf(float x); double log10(double x); float log10f(float x); double log1p(double x); float log1pf(float x); double log2(double x); float log2f(float x); DESCRIPTION
The following functions compute logarithms: o The log() and logf() functions return the natural logarithm. o The log10() and log10f() functions return the base 10 logarithm. o The log1p() and log1pf() functions return the natural logarithm of (1.0 + x) accurately even for very small values of x. o The log2() and log2f() functions return the base 2 logarithm. RETURN VALUES
Upon successful completion, the functions return the logarithm of x as descibed above. Otherwise the following may occur: 1. If x is NaN, all functions return NaN. 2. If x is positive infinity, all functions return x. If x is negative infinity, all functions return NaN. 3. If x is +0.0 or -0.0, the log(), log10(), and log2() families return either -HUGE_VAL, -HUGE_VALF, or -HUGE_VALL, whereas the log1p() family returns x. 4. If x is +1.0, the log(), log10(), and log2() families return +0.0. If x is -1.0, the log1p() family returns -HUGE_VAL, -HUGE_VALF, or -HUGE_VALL. In addition, on a VAX, errno is set to EDOM and the reserved operand is returned by log() unless x > 0, by log1p() unless x > -1. SEE ALSO
exp(3), ilogb(3), math(3) STANDARDS
The described functions conform to ISO/IEC 9899:1999 (``ISO C99''). HISTORY
The history of the logarithm functions dates back to Version 6 AT&T UNIX. BSD
September 13, 2011 BSD

Featured Tech Videos

All times are GMT -4. The time now is 04:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy