Sponsored Content
Full Discussion: Data imputation with scaling
Top Forums Shell Programming and Scripting Data imputation with scaling Post 302932320 by MadeInGermany on Tuesday 20th of January 2015 05:07:41 PM
Old 01-20-2015
Here is an awk framework that lists the required values.
Code:
awk 'NR==FNR {s[$1]=$2; next} ($1 in s) {lo=hi; nlo=nhi; hi=$2; nhi=$1; for (i=1;i<=bc;i++) {print name[i],s[nlo],s[nhi],ns[i],hi,lo} bc=0; next} {ns[++bc]=$2; name[bc]=$1}' base non-base

Adding the formula is left as an exercise...
This User Gave Thanks to MadeInGermany For This Post:
 

We Also Found This Discussion For You

1. Shell Programming and Scripting

Re-scaling values - perl

Hey folks I have a big tab delimited file with 3 columns looks like this: chr2L 552 0.85 chr2R 135 1.06 chr3L 820 2.89 chr3R 581 3.93 chr4 585 0.94 chrX 605 1.93 All I want to do is re-scaling the third column to be between 0-1. Which means that the highest valu in 3rd column will... (5 Replies)
Discussion started by: @man
5 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 07:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy