Skip to content

Instantly share code, notes, and snippets.

@clairvy
Created September 28, 2009 06:51
Show Gist options
  • Save clairvy/195240 to your computer and use it in GitHub Desktop.
Save clairvy/195240 to your computer and use it in GitHub Desktop.
$ cat a
a b c
d e
f
$ awk '{n = split($0, a); for(i = 1; i <= n; i += 1) { print i, a[i] }}' a
1 a
2 b
3 c
1 d
2 e
1 f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment