Search Results

Search: Posts Made By: awkward
7,102
Posted By awkward
You are right it is a solution to my previous...
You are right it is a solution to my previous threads, I solved it and posted for someone who has same problem.

Regards,
awkward
7,102
Posted By awkward
AWK solution to subtract multiple columns of numbers
Hope somebody is happy.

NR==1 {
num_columns=split( $0, menuend );
next;
}

{
split( $0, substrend );
for ( i=1; i<=NF; i++ ) {
minuend[i] -= substrend[i];
...
2,671
Posted By awkward
I am not a programmer or a student so it looks...
I am not a programmer or a student so it looks like I do not understand fully your reply
to my post.
Actually I meant that one file consists of multiple columns and subtraction must be done on each...
4,158
Posted By awkward
AWK subtraction in multiple columns
AWK subtraction in multiple columns

Hi there,

Can not get the following:

input: 34523 934
9485 3847
394 3847
3456 9384

awk 'NR==1 {for (i =...
2,671
Posted By awkward
number subtraction of multiple columns
I get the point of number subtraction in one column

awk 'NR==1 {n=$1; next}; {n-=$1} END {print n}' inputfile

but I cannot figure it out how to do this to multiple
columns.

awkward.
Showing results 1 to 5 of 5

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