Search Results

Search: Posts Made By: LearningLinux2
1,576
Posted By pamu
try this awk -F,...
try this


awk -F, '{for(i=4;i<=NF;i++){s+=$i}{$(NF+1)=s;s=0}}1' OFS="," file
1,576
Posted By pamu
awk -F, '{for(i=4;i<=NF;i++){s+=$i}{$(NF+1)=s}}1'...
awk -F, '{for(i=4;i<=NF;i++){s+=$i}{$(NF+1)=s}}1' OFS="," file
1,576
Posted By rdrtx1
or: awk -F,...
or:
awk -F, 'BEGIN{OFS=","}{for(i=4;i<=NF;i++)s+=$i;print $0,s}' infile > another_file
Showing results 1 to 3 of 3

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