Search Results

Search: Posts Made By: miriammiriam
1,150
Posted By joeyg
This may be a start
$ paste sample3.txt sample4.txt | awk '{v1=$1+($1*$5);v2=$2+($2*$6); printf "%-6.2f %-6.2f\n",v1,v2}'
10.00 21.60
63.00 74.20
20.40 30.30
Above does the first two output columns, you could...
1,150
Posted By i150371485
Try This : awk...
Try This :


awk 'FNR==NR{for(i=1;i<=NF;i++) e[FNR,i]=$i;next}
{for(i=1;i<=NF;i++)

printf("%s%s",e[FNR,i]+e[FNR,i]*$i,i==NF?"\n":" ")
}' A B
5,713
Posted By Ygor
The same code reformatted via gawk --profile...
The same code reformatted via gawk --profile gives... # gawk profile, created Wed Jul 25 09:58:45 2012

# BEGIN block(s)

BEGIN {
f1 = 0
i...
5,713
Posted By raj_saini20
try this $awk 'BEGIN{f1=0;i=1;k=1;while...
try this

$awk 'BEGIN{f1=0;i=1;k=1;while (getline < "file2" ){a[i++]=$2}}
{if($1 ~ /^[A-Z]/){l=length($0);for(j=1;j<=l;j=j+6){val=substr($0,j,6);if(val ~ /^[A-Z]/){val=substr($0,j,6);f1=1;printf...
5,713
Posted By raj_saini20
Try this (tested in hp-ux) $awk...
Try this (tested in hp-ux)


$awk 'BEGIN{f1=0;i=1;k=1;while (getline < "file2"){a[i++]=$2}}
{if($1 ~ /^[A-Z]/){l=length($0);for(j=1;j<=l;j=j+6){val=substr($0,j,6);if(val ~ /^[A-Z]/){f1=1;printf...
2,722
Posted By itkamaraj
create a file addfr.awk and put the below...
create a file addfr.awk and put the below contents inside the addfr.awk


BEGIN { A["FRR1"]=0.11; A["FRR4"]=0.13 }

A[$1] {
V=substr($0, 24, 5);
V += A[$1]
...
5,308
Posted By Scrutinizer
Try: awk '{sub($9 " *FRO ",$9-1.3 " FRO ")}1'...
Try:
awk '{sub($9 " *FRO ",$9-1.3 " FRO ")}1' infile
Showing results 1 to 7 of 7

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