Search Results

Search: Posts Made By: fat
1,998
Posted By RudiC
Try awk ' {F2[$1]=F2[$1]"/"$2 ...
Try awk ' {F2[$1]=F2[$1]"/"$2
F3[$1]=F3[$1]"/"$3
F4[$1]=F4[$1]";"$4}
END {for (S1 in F2)
print S1,
...
1,047
Posted By migurus
awk based solution $ cat test.sh awk '...
awk based solution

$ cat test.sh
awk '
{
if (NR == FNR) ### reading 1st file
### accumulate 2nd column values in array of key values
{
...
1,353
Posted By in2nix4life
Nice one Akshay. I made a modification to...
Nice one Akshay.

I made a modification to allow sorting within the awk statement:


awk '{A[$1]=A[$1] ? A[$1] OFS $2 : $2}END{for(i in A)print i, A[i] | "sort"}' file*
rs0001 100e-34 1.98e-22...
1,353
Posted By Akshay Hegde
Try $ awk '{A[$1] = A[$1] ? A[$1] OFS $2 :...
Try

$ awk '{A[$1] = A[$1] ? A[$1] OFS $2 : $2}END{for(i in A)print i, A[i]}' file* | sort--edit--

Oops looks like desired o/p modified :)
$ awk 'BEGIN{printf "\t"}{A[$1] = A[$1] ? A[$1] OFS...
Showing results 1 to 4 of 4

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