10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a input text file in this format:
ITEM1 10.9 20.1
ITEM2 11.6 12
ITEM3 14 15.7
ITEM5 20 50.6
ITEM6 25 23.6
I want to print those lines which have more than 5% difference between second and third columns. (8 Replies)
Discussion started by: ctrld
8 Replies
2. Shell Programming and Scripting
I have the need to match the first two columns and when they match, calculate the percent of average for the third columns. The following awk script does not give me the expected results.
awk 'NR==FNR {T=$3; next} $1,$2 in T {P=T/$3*100; printf "%s %s %.0f\n", $1, $2, (P>=0)?P:-P}' diff.file... (1 Reply)
Discussion started by: ncwxpanther
1 Replies
3. Shell Programming and Scripting
This matrix represents correlation values.
Is it possible to calculate the percentage of columns (a1, a2, a3) that have a value >= |0.5| and report the percentage that has positive correlation >0.5 and negative correlation <-0.5 separately. thanx in advance!
input
name a1 a2 a3... (5 Replies)
Discussion started by: quincyjones
5 Replies
4. Shell Programming and Scripting
Hello geeks, Find below a Perl script am writing to calculate some failure rate in our GPRS network, am just starting to use perl for scripting.
#!/usr/bin/perl
#Script written to calculate the following:
#PDP activation failure rate for every 15 minutes interval
#Number of Active PDP... (1 Reply)
Discussion started by: infinitydon
1 Replies
5. Shell Programming and Scripting
Hi, I need help with the awk command.
I have a folder with aprox 500 files each one with two columns and I want to print in a new file, the average of column 1 and average of column 2 and the name of each file.
Input files are:
File-1:
100 99
20 99
50 99
50 99
File-2:
200 85... (3 Replies)
Discussion started by: Lokaps
3 Replies
6. Shell Programming and Scripting
Hi everyone,
I am trying to find sty all day.
I have two files:
File 1:
N 82 AAA A 1 0.67
N 83 BBB B 1 0.79
N 84 CCC C 1 0.11
File 2:
N 82 AAA A 1 0.63
N 83 BBB B 1 0.03
N 84 CCC C 1 0.08
I want to calculate... (2 Replies)
Discussion started by: Tzole
2 Replies
7. Shell Programming and Scripting
Thanks Bartus11 for your help in the following code to compare the two files "t1" and "t2".
awk 'NR==FNR{a=1;next}$2 in a{print $2}' t1 t2
First can anyone explain that what is the purpose of assigning a =1?
Second, the current script is printing out the matched columns between the... (4 Replies)
Discussion started by: coder83
4 Replies
8. Shell Programming and Scripting
In database.txt
tourID:name:buyin:buyout
0001:SundayMillion:210:1000000
0002:MondayMillion:115:114
0003:Tuesday:123:0
0004:Thrusday:12412:26
I want the outpout:
The higher value is SundayMillion, proffit 999790 euros.
The lower value is MondayMillion, proffit 1 euros.
The value more... (6 Replies)
Discussion started by: rafazz
6 Replies
9. Shell Programming and Scripting
Dear All,
I need to find the difference between two adjacent columns. The file is having 'i' columns and i need to find the difference between two adjacent columns (like $1 difference $2; $2 difference $3; .... and $(i-1) difference $i). I have used the following coding
awk '{ for (i=1; i<NF;... (7 Replies)
Discussion started by: Fredrick
7 Replies
10. Solaris
All.
How can i calculate the fragmentation ratio on a mounted disk, given that i have no root privilege and i cannot switch to single user mode. (0 Replies)
Discussion started by: Negm
0 Replies