Search Results

Search: Posts Made By: jagdishrout
1,200
Posted By Yoda
awk -F\| ' NR==1 { printf "%s", $0; ...
awk -F\| ' NR==1 {
printf "%s", $0;
p = $1;
} p == $1 {
printf ",%s", $2;
} p != $1 {
printf "\n%s", $0;
} {
p = $1;
} END {
printf "\n";
}'...
1,584
Posted By Scrutinizer
Like so? awk 'p!=$1{if(p)print s; s=$1 "|" $2;...
Like so?
awk 'p!=$1{if(p)print s; s=$1 "|" $2; p=$1; next}{s=s "," $2} END{print s}' infile
1,584
Posted By RudiC
awk ' {Ar[$1] = Ar[$1](Ar[$1]?",":"")$2} ...
awk ' {Ar[$1] = Ar[$1](Ar[$1]?",":"")$2}
END {for (i in Ar) print i, Ar[i]}
' file
BUD,BDL BUDCAR,BUDLAMP
JKL,HNM,KTY,KJY JAGAN,HOUSE,KATAK,KOLKA
ABC,CDF,KLT...
2,085
Posted By clx
If you want to remove space anywhere in the file....
If you want to remove space anywhere in the file.

sed 's/[ ]//g' file
4,530
Posted By Scrutinizer
awk -F, '{print $0,$1 RS $0,$2}' file
awk -F, '{print $0,$1 RS $0,$2}' file
Showing results 1 to 5 of 5

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