Search Results

Search: Posts Made By: Ghetz
1,456
Posted By pravin27
Hi Ghetz, Sorry .... Try this, ...
Hi Ghetz,

Sorry ....

Try this,


sort -nk2,1 inputfile -o inputfile; awk 'NR==FNR{if(s!=$1){j=0;s=$1}a[$1]=++j;next} {if(p!=$1){i=0;p=$1}if(a[p]){$4=a[p]}$5=++i;print }' OFS="\t" inputfile...
1,456
Posted By Scrutinizer
NR==FNR is only useful when there is more than...
NR==FNR is only useful when there is more than one input file. Try this, assuming column one is in sorted order:
awk 'function pr(){if(p)for(i=1;i<=n;i++){print A[i],n,i;delete...
Showing results 1 to 2 of 2

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