Skip to content
Snippets Groups Projects
Commit b1a06ca5 authored by Tom Fischer's avatar Tom Fischer
Browse files

Script for moving the porosity specification from solid phase to medium scale.

parent acf05265
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash
#set -x
number_of_medium_tags=`xmlstarlet sel -t -v "count(///*/medium)" $1`
number_of_medium_tags=$(($number_of_medium_tags - 1))
xmlstarlet ed --move "//OpenGeoSysProject/media/medium[@id=0]/phases/phase/properties/property[name='porosity']" "//OpenGeoSysProject/media/medium[@id=0]/properties" $1 > /tmp/t0.prj
for i in `seq 1 ${number_of_medium_tags}`;
do
i_m_e=$(($i-1))
#echo "${i}, ${i_m_e}"
path="//OpenGeoSysProject/media/medium[@id="${i}"]"
xmlstarlet ed --move "$path/phases/phase/properties/property[name='porosity']" "$path/properties" /tmp/t$i_m_e.prj > /tmp/t${i}.prj
done
#format the result file
xmlstarlet fo -s 4 /tmp/t${number_of_medium_tags}.prj > ${1}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment