From: John Tsiombikas Date: Wed, 7 Dec 2016 15:07:17 +0000 (+0200) Subject: prepare_data script now accepts a filter argument to process only a X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=commitdiff_plain;h=619c5f42a1bf0dcf16fd9210e0e4d7d42fecf5de prepare_data script now accepts a filter argument to process only a subset of data matching that filter (with grep) --- diff --git a/tools/prepare_data b/tools/prepare_data index 76ced9f..c1bf5f8 100755 --- a/tools/prepare_data +++ b/tools/prepare_data @@ -3,6 +3,7 @@ indir=datasrc descfile=$indir/datadesc outdir=data +filter=$1 process() { @@ -33,10 +34,14 @@ copy() fi } +if [ -z "$filter" ]; then + filter='.*' +fi + mkdir -p $outdir while read line; do - line=$(echo $line | sed 's/#.*$//') + line=$(echo $line | sed 's/#.*$//' | grep "$filter") if [ -n "$line" ]; then path=$(echo $line | awk -F : '{ print $1; }') fname=$(basename $path)