Created
November 20, 2018 20:07
-
-
Save stardigits/02360e7168d0d7ba5a3be3b63258407b to your computer and use it in GitHub Desktop.
Transpose CSV string header with line number in Bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example: | |
# echo "one,two,three,four,five" | csv_header | |
# Result: | |
# 1 one | |
# 2 two | |
# 3 three | |
# 4 four | |
# 5 five | |
csv_header () { head -1 | tr , \\n | cat -n; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment