Search Results

Search: Posts Made By: preethgideon
1,953
Posted By mirni
Well that was not very constructive. Here...
Well that was not very constructive.

Here you go:

awk '
NR==1{ printf("%20s\t%10s\t%10s\n", $1,"+ve Cr","-ve Cr")}
NR>1{ if($2>0) sumPos[$1] += $2;
else sumNeg[$1] += $2;
...
2,015
Posted By clx
Are you looking for something like this? $...
Are you looking for something like this?

$ awk -F, 'BEGIN {while (( getline < "2" ) > 0 ){a[$1]=$2}} NR==FNR {b[$1]=$2FS$3;next} {print $1,$2,a[$2],b[a[$2]]}' OFS=, 3 1
name1,11,sub1,sc1,c1...
2,015
Posted By Scrutinizer
You could give this a try: awk -F, 'FNR==1{f++}...
You could give this a try:
awk -F, 'FNR==1{f++} f==1{E[$2]=$1} f==2{S[$1]=$0} f==3{print E[$1],$1,S[$2]}' OFS=, file1 file3 file2
Showing results 1 to 3 of 3

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