Last active
October 24, 2020 03:56
-
-
Save ymattu/b6b3025cfcced41513541059d4afa63f to your computer and use it in GitHub Desktop.
複数の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
#!/bin/bash | |
counter=0 | |
for file in `\find . -maxdepth 1 -name '*.csv'`; | |
do | |
echo $file | |
if [ $counter == 0 ]; then | |
cat $file > join_result.csv | |
else | |
sed -e '1d' $file >> result.csv | |
fi | |
counter=`expr $counter + 1` | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment