Created
March 21, 2016 17:52
-
-
Save cuevasclemente/7a784d78f6684fe07563 to your computer and use it in GitHub Desktop.
Shell one-liner to: Get the first row of a bunch of CSV files (ostensibly headers) and write them all to the same file, but with the first element of that file being the name of the file without `csv`
This file contains hidden or 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
$ for file in *.csv; do echo "${file%.csv},$(head -n 1 $file)" >> headers; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment