Created
March 3, 2021 07:12
-
-
Save tayeke/95975d4e44a992c147aa1982a40da175 to your computer and use it in GitHub Desktop.
Prepend a line to a bunch of CSVs in a folder
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
#!/bin/bash | |
cd "path/to/folder" | |
for file in *.csv; do | |
test -f "$file" || continue | |
echo "\"column one\",\"column two\" | cat - "$file" > "temp" && mv "temp" "$file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment