Search Results

Search: Posts Made By: prashu_g
3,689
Posted By agama
Simple change to the awk you have working: ...
Simple change to the awk you have working:


awk -F"; " '{for (i=1;i<=NF;i++) a[$i]=1}END{for (i in a) printf( "%s; ", i ); printf( "\n" ); }' file
2,078
Posted By balajesuri
nawk -F, '{OFS=","}{a[$1]+=$2}END{for(i in...
nawk -F, '{OFS=","}{a[$1]+=$2}END{for(i in a){print i, a[i]}}' test.txtOFS => Output Field Separator. This contains the character with which output fields would be separated. In this case, its...
2,078
Posted By itkamaraj
$ nawk -F, '{OFS=","}{a[$1]+=$2}END{for(i in...
$ nawk -F, '{OFS=","}{a[$1]+=$2}END{for(i in a){print i, a[i]}}' test.txt
wednesday,43
thursday,34
tuesday,10
monday,45
friday,12
10,830
Posted By zaxxon
If the additional blank is/was no problem you can...
If the additional blank is/was no problem you can try:

$> awk 'NR>2 {$NF=","$NF; print}' infile
OS Related Issues ,1
EMEA Solutions ,9
Global Solutions ,2
10,830
Posted By itkamaraj
$ awk '{for(i=1;i<NF;i++){printf("%s ",$i)}...
$ awk '{for(i=1;i<NF;i++){printf("%s ",$i)} printf(",%s\n",$NF)}' test.txt
OS Related Issues ,1
EMEA Solutions ,9
Global Solutions ,2

---------- Post updated at 01:39 PM ---------- Previous...
Showing results 1 to 5 of 5

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