SyntaxFix
Write A Post
Hire A Developer
Questions
Using awk.
i starts at 0, i++ will increment the value of i, but return the original value that i held before being incremented.
i++
awk '{print i++ "," $0}' file