## Convert .txt to .cellml # If this script cannot be loaded, type "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process" in the PowerShell terminal # The OpenCOR installation folder path $dpath= 'C:/Users/wai484/Documents/OpenCOR' # The text file name $txtfiles="JVOCCi", "JNCXi", "JSERCAi", "JCICRi", "JPMCAi", "Jleaki", "JNKAi","JCli","JKi","Para","Cai","Casr","Vm","PASMC" # The model directory where .txt and .cellml are saved $mpath='C:/Users/wai484/Documents/SinglePASMC/Components' # Execute the command to do the conversion foreach ($txtfile in $txtfiles) { .$dpath/OpenCOR -c CellMLTextView::export $mpath/$txtfile.txt | out-file $mpath/$txtfile.cellml -encoding utf8 } $mpath='C:/Users/wai484/Documents/SinglePASMC/Experiments' .$dpath/OpenCOR -c CellMLTextView::export $mpath/PASMC_test.txt | out-file $mpath/PASMC_test.cellml -encoding utf8