Skip to content

Commit

Permalink
add script for batch processing
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiseu committed Mar 26, 2019
1 parent f493a4d commit a6649be
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions PAT-post-processing/batch-process.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## script for post processing PAT data in batch
## ${Base_dir} contains all the PAT source data that needs to be processed, change this dir to your own
Base_dir=/home/test1

################################################################################
## DO NOT NEED TO EDIT BELOW PARTS!!!
################################################################################
PAT_POST_HOME=$( cd $( dirname ${BASH_SOURCE[0]} ) && pwd )

Original_name="PAT-Result"
for item in `ls ${Base_dir}`
do
echo "Processing ${item}..."
New_name=${item}
New_dir=${Base_dir}/${item}/instruments/
sed -i "s/${Original_name}/${New_name}/g" ${PAT_POST_HOME}/pat-post-process.py
sed -i "s|<source>.*</source>|<source>${New_dir}</source>|g" ${PAT_POST_HOME}/config.xml
#${PAT_POST_HOME}/pat-post-process.py
echo "${item} done!"
Original_name=${New_name}
done
## change back to original value
sed -i "s/${Original_name}/PAT-Result/g" ${PAT_POST_HOME}/pat-post-process.py
sed -i "s|<source>.*</source>|<source>/foo/bar/instruments/</source>|g" ${PAT_POST_HOME}/config.xml



0 comments on commit a6649be

Please sign in to comment.