Created
April 15, 2015 10:00
-
-
Save willycs40/f12e4b5051d1d8591e26 to your computer and use it in GitHub Desktop.
Using Cygwin to combine csvs
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
# Get the row names and put them in a new file called combined.csv | |
head -4 firstFile.txt | tail -1 > combined.csv | |
# Get the data from all files and append to combined.csv | |
# The more complicated 'find, while, do, done' is there because my file names had spaces in | |
find ./*.txt | while read file; do awk 'NR>5' "$file"; done >> combined.csv | |
# Finally do a row count reconcilisation | |
wc -l *.txt && wc -l combined.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment