christian
christian

Reputation: 49

AWK: How to increment values in a column by one

In a previous question I asked how to decrement the value of all entries in a column by 1

The (correct) answer was awk '{ $7--; print $0 }', where $7 means the 7th column

What would an analogous answer for INCREMENTING column values be?

Thanks so much

Christian

Upvotes: 1

Views: 7726

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798686

Use ++ instead of --.

Upvotes: 2

Related Questions