Search Results

Search: Posts Made By: haczyk
1,190
Posted By Scrutinizer
Hi, you kept in && NR > 1, that shouldn't be...
Hi, you kept in && NR > 1, that shouldn't be there..

--
So, records that are missing have a value of 0? Try:
awk -F, 'function pr(){printf "%s;%.2f\n",p,100*f/s} p!=$2{if(p)pr(); p=$2;...
1,190
Posted By agama
This assumes that the value in the first column...
This assumes that the value in the first column is always greater than zero:


awk -F , '
$2 != l && NR > 1 {
printf( "%s; %.3f\n", l, (f/sum) * 100 );
f = sum = $1;
...
2,409
Posted By agama
I took a different approach that assumed the...
I took a different approach that assumed the config file couldn't be changed.


awk -F "," '
NR != FNR {
gsub( "\"", "", $0 );
x = $3 " " $2;
if( x in tab1 && $13...
2,409
Posted By Corona688
Is that the way your conf file has to be, or can...
Is that the way your conf file has to be, or can you reorganize it as you please? That's not how I'd have organized it, it takes a bit more processing that way... Just simple files like
name1...
6,835
Posted By jlliagre
Here is something probably much faster than your...
Here is something probably much faster than your previous attempts:

startDate="2012/01/01 00:00:00"
endDate="2012/04/15 00:00:00"
gawk -F'","' \
-v start=${startDate//[\/ :]/} \
-v...
6,835
Posted By Scrutinizer
I get the same error using mawk. Try using gawk...
I get the same error using mawk. Try using gawk instead of mawk
Showing results 1 to 6 of 6

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