Skip to content

Instantly share code, notes, and snippets.

@ymattu
Last active October 24, 2020 03:56
Show Gist options
  • Save ymattu/b6b3025cfcced41513541059d4afa63f to your computer and use it in GitHub Desktop.
Save ymattu/b6b3025cfcced41513541059d4afa63f to your computer and use it in GitHub Desktop.
複数のcsvを連結し、最初のファイル以外はヘッダーを削除するシェルスクリプト
#!/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