Sponsored Content
Full Discussion: Re-scaling values - perl
Top Forums Shell Programming and Scripting Re-scaling values - perl Post 302869941 by rdrtx1 on Thursday 31st of October 2013 02:26:51 PM
Old 10-31-2013
try also:
Code:
awk '
{a[NR]=$1; b[NR]=$2; c[NR]=$3; $3 > mx ? mx=$3 : 0}
END { for (i=1; i<=NR; i++) printf ("%-6s%6d%7.2f\n", a[i], b[i], c[i]/mx ); }
' infile

(sort aside)
 

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl -write values in a file to @array in perl

Hi can anyone suggest me how to write a file containing values,... say 19 20 21 22 .. 40 to an array @array = (19, 20, ... 40) -- Thanks (27 Replies)
Discussion started by: meghana
27 Replies

2. Shell Programming and Scripting

Perl :: reading values from Data Dumper reference in Perl

Hi all, I have written a perl code and stored the data into Data structure using Data::Dumper module. But not sure how to retreive the data from the Data::Dumper. Eg. Based on the key value( Here CRYPTO-6-IKMP_MODE_FAILURE I should be able to access the internal hash elements(keys) ... (1 Reply)
Discussion started by: scriptscript
1 Replies

3. Shell Programming and Scripting

Data imputation with scaling

Hello masters, this is difficult to explain and maybe complicated to implement...looks beyond what I taught myself (from this forum), some help is greatly appreciated. I have a base file a1 10 a2 15 a3 20 a4 21 I have a non-base file a1 170 b12 175 c12 180 d12 190 a2 ... (3 Replies)
Discussion started by: senhia83
3 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 02:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy