Sponsored Content
Top Forums Shell Programming and Scripting Calculate 2nd Column Based on 1st Column Post 302734369 by msathees on Thursday 22nd of November 2012 02:19:32 AM
Old 11-22-2012
Hi,

can you try with $2 instead of $1 in all the print functions-- print ((4086-$2)*2)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

split the file based on the 2nd column passing as a parameter

I am unable to spit the file based on the 2nd column passing as a parameter with awk command. Source file: “100”,”customer information”,”10000” “200”,”customer information”,”50000” “300”,”product information”,”40000” script: the command is not allowing to pass the parameters with the awk... (7 Replies)
Discussion started by: number10
7 Replies

2. Shell Programming and Scripting

comparing column of two different files and print the column from in order of 2nd file

Hi friends, My file is like: Second file is : I need to print the rows present in file one, but in order present in second file....I used while read gh;do awk ' $1=="' $gh'" {print >> FILENAME"output"} ' cat listoffirstfile done < secondfile but the output I am... (14 Replies)
Discussion started by: CAch
14 Replies

3. Shell Programming and Scripting

1st column,2nd column on first line 3rd,4th on second line ect...

I need to take one column of data and put it into the following format: 1st line,2nd line 3rd line,4th line 5th line,6th line ... Thanks! (6 Replies)
Discussion started by: batcho
6 Replies

4. Shell Programming and Scripting

Transpose timestamp based on column values and calculate time difference

Hello Expert, I need to transpose Date-Timestamp based on same column values and calculate time difference. The input file would be as below and required output is mentioned in the bottom INPUT File ======== 08/23/2012 12:36:09 JOB_5340 08/23/2012 12:36:14 JOB_5340 08/23/2012... (2 Replies)
Discussion started by: asnandhakumar
2 Replies

5. Shell Programming and Scripting

Calculate difference in timestamps based on unique column value

Hi Friends, Require a quick help to write the difference between 2 timestamps based on a unique column value: Input file: 08/23/2012 12:36:09,JOB_5340,08/23/2012 12:36:14,JOB_5340 08/23/2012 12:36:22,JOB_5350,08/23/2012 12:36:26,JOB_5350 08/23/2012 13:08:51,JOB_5360,08/23/2012... (4 Replies)
Discussion started by: asnandhakumar
4 Replies

6. Shell Programming and Scripting

Calculate the average of a column based on the value of another column

Hi, I would like to calculate the average of column 'y' based on the value of column 'pos'. For example, here is file1 id pos y c 11 1 220 aa 11 4333 207 f 11 5333 112 ee 11 11116 305 e 11 11117 310 r 11 22228 781 gg 11 ... (2 Replies)
Discussion started by: jackken007
2 Replies

7. Shell Programming and Scripting

Sum column values based in common identifier in 1st column.

Hi, I have a table to be imported for R as matrix or data.frame but I first need to edit it because I've got several lines with the same identifier (1st column), so I want to sum the each column (2nd -nth) of each identifier (1st column) The input is for example, after sorted: K00001 1 1 4 3... (8 Replies)
Discussion started by: sargotrons
8 Replies

8. Linux

Print the 1st column and the value in 2nd or 3rd column if that is different from the values in 1st

I have file that looks like this, DIP-17571N|refseq:NP_651151 DIP-17460N|refseq:NP_511165|uniprotkb:P45890 DIP-17571N|refseq:NP_651151 DIP-19241N|refseq:NP_524261 DIP-19241N|refseq:NP_524261 DIP-17151N|refseq:NP_524316|uniprotkb:O16797 DIP-19588N|refseq:NP_731165 ... (2 Replies)
Discussion started by: Syeda Sumayya
2 Replies

9. Shell Programming and Scripting

Calculate 5th percentile based on another column

I would like to have some help in calculating 5th percentile value of column 2 for each site, the input is like below:site val1 val2 002 10 25.3 002 20 25.3 002 30 25.3 002 40 20 002 50 20 002 60 20 002 70 20 002 80 30 002 90 30 002 100 30 002 120 30 003 20 30.3 003 20 30.3 003 30 20... (2 Replies)
Discussion started by: wuhuai
2 Replies

10. UNIX for Beginners Questions & Answers

Compare 1st column from 2 file and if match print line from 1st file and append column 7 from 2nd

hi I have 2 file with more than 10 columns for both 1st file apple,0,0,0...... orange,1,2,3..... mango,2,4,5..... 2nd file apple,2,3,4,5,6,7... orange,2,3,4,5,6,8... watermerlon,2,3,4,5,6,abc... mango,5,6,7,4,6,def.... (1 Reply)
Discussion started by: tententen
1 Replies
APR-1-CONFIG(1) 						   User Commands						   APR-1-CONFIG(1)

NAME
apr-1-config - Return metainformation about apr library SYNOPSIS
apr-1-config [OPTION] DESCRIPTION
The apr-1-config program is used to retrieve information about the apr library in the system. It is typically used to compile and link against the library. When linking with libtool, an application should do something like: APR_LIBS="`apr-1-config --link-libtool --libs`" or when linking directly: APR_LIBS="`apr-1-config --link-ld --libs`" An application should use the results of --cflags, --cppflags, --includes, and --ldflags in their build process. OPTIONS
Known values for OPTION are: --prefix[=DIR] change prefix to DIR --bindir print location where binaries are installed --includedir print location where headers are installed --cc print C compiler name --cpp print C preprocessor name and any required options --cflags print C compiler flags --cppflags print C preprocessor flags --includes print include information --ldflags print linker flags --libs print additional libraries to link against --srcdir print APR source directory --installbuilddir print APR build helper directory --link-ld print link switch(es) for linking to APR --link-libtool print the libtool inputs for linking to APR --shlib-path-var print the name of the shared library path env var --apr-la-file print the path to the .la file, if available --apr-so-ext print the extensions of shared objects on this platform --apr-lib-target print the libtool target information --apr-libtool print the path to APR's libtool --version print the APR's version as a dotted triple --help print the help AUTHOR
This manual page was written by Vincent Danjean <Vincent.Danjean@ens-lyon.org> for the Debian project (but may be used by others). apr-1-config 1.2.2 March 2006 APR-1-CONFIG(1)
All times are GMT -4. The time now is 04:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy