echo "Start"
IFS=''
while read p; do
  echo $p
  while read n; do
    m="${n/R_T_/}"
    if [[ $p == *"name=\"$m\""* ]]; then
      echo "<variable name=\"R_T\" private_interface=\"in\" units=\"Js_per_m6\"/>"
    fi
    if [[ $p == *"component_1=\"$m\""* ]]; then
      echo "<map_variables variable_1=\"R_T\" variable_2=\"R_T\"/>"
    fi
  done <R_T_names.txt
done <main_ADAN-218.cellml >main_ADAN-218_new.cellml
