Created
June 17, 2014 07:24
-
-
Save zonca/96e7651830f777b070b7 to your computer and use it in GitHub Desktop.
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
# bash script to process inflammation data | |
# call with "http://npk.io/RBzU+" | |
echo Clean previous runs | |
rm -r data* | |
echo Download data | |
curl -L $1 -o data.zip | |
sleep 2 | |
echo Unzip | |
unzip -x data.zip | |
cd data | |
sleep 2 | |
echo Available files | |
ls -a -F | |
sleep 2 | |
echo Cleanup | |
rm ._*.csv | |
mkdir bad_data | |
mv *broken* *metadata* bad_data/ | |
sleep 2 | |
echo Renaming | |
todays_date=`date +%Y-%m-%d` | |
for f in *.csv | |
do | |
mv $f ${f/-/_${todays_date}_} | |
done | |
echo Files after renaming | |
ls *csv | |
sleep 2 | |
echo Processing | |
for f in *.csv | |
do | |
echo Processing $f | |
/c/Program\ Files/R/R-3.1.0/bin/Rscript.exe plot_inflammation.r $f | |
sleep 1 | |
done | |
echo Move figures | |
mkdir figures | |
mv *png figures/ | |
echo Completed | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment