Search Results

Search: Posts Made By: sramirez
6,936
Posted By mirni
For starters: You're splitting the master on...
For starters:
You're splitting the master on whitespaces and assigning
$fieldsM[2], which is not defined (only 2 columns in your masterList.txt). Here:
my $value= $fieldsM[2];---------- Post...
11,689
Posted By Shell_Life
Had extra time to play. One line of awk...
Had extra time to play.

One line of awk versus 52 lines of shell script:
#!/usr/bin/ksh
typeset -i mTot=0
typeset -i mInd
mPrev1="First"
rm -f F_Summ
while read mCol1 mCol2; do
if [[...
11,689
Posted By pravin27
Perl #!/usr/bin/perl while (<DATA>) { ...
Perl
#!/usr/bin/perl

while (<DATA>) {
@a=split(/\s+/);
unless (exists $col2{$a[1]}) {$col2{$a[1]}++;}
$b{$a[0]}=$b{$a[0]}." ".$a[1];
}

printf "\t";
printf "%s ",$_ foreach...
11,689
Posted By vgersh99
This should not matter. nawk...
This should not matter.

nawk '{a[$1,$2]++;r[$1];c[$2]}END {for(ci in c) printf OFS ci;print "";for (ri in r) {printf ri; for (ci in c) {idx=ri SUBSEP ci;printf OFS ((idx in a)?a[idx]:0)}print...
1,592
Posted By binlib
Since you didn't define what quantifies as...
Since you didn't define what quantifies as closest, I made up the number 3.5. You may need to fine tune the function closest to get the best approximation.
awk '
function closest(x, i , j)
{
...
Showing results 1 to 5 of 5

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