Search Results

Search: Posts Made By: pistachio
1,797
Posted By joeyg
You used || when you should have && $ echo...
You used || when you should have &&

$ echo 100,2.4 | awk -F"," '{if ($2>1 && $2<2) print $1","$2}'


$ echo 100,1.4 | awk -F"," '{if ($2>1 && $2<2) print $1","$2}'
100,1.4
35,472
Posted By matrixmadhan
A small change please :) A separate rows...
A small change please :)

A separate rows variable is not needed, just this would do
awk -F, ' NR > 1 { sum += $2 }END{ print NR-1, sum }' filename
Showing results 1 to 2 of 2

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