Quantcast
Channel: awk: subtract the last from the first element of each column and print results - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by jaypal singh for awk: subtract the last from the first element of...

Here is how you can do it:You create an array iterating over each elements of the first line and then in the END block you iterate again subtracting the column with values from array. awk ' NR==1 { for...

View Article



awk: subtract the last from the first element of each column and print results

I have the following question about awk. I have a file with some columns, like1 5 26 1 87 9 9I want to calculate the difference between the last and the first element of every column: 7-1=6, 9-5=4,...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images