## 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="Para","C0_S2","CN_S2","C_S3","O0_S2","ON_S2","O_S3","MWC_10","MWC_18" # The model directory where .txt files are saved $tpath='C:/Users/wai484/Documents/ECC_MSK_Rios_1993/Components/buildsrc' # The model directory where .cellml files are saved $cpath='C:/Users/wai484/Documents/ECC_MSK_Rios_1993/Components' # Execute the command to do the conversion foreach ($txtfile in $txtfiles) { .$dpath/OpenCOR -c CellMLTextView::export $tpath/$txtfile.txt | out-file $cpath/$txtfile.cellml -encoding utf8 } $txtfile="MWC_10_test" $cpath='C:/Users/wai484/Documents/ECC_MSK_Rios_1993/Experiments' .$dpath/OpenCOR -c CellMLTextView::export $tpath/$txtfile.txt | out-file $cpath/$txtfile.cellml -encoding utf8 $txtfile="MWC_18_test" $cpath='C:/Users/wai484/Documents/ECC_MSK_Rios_1993/Experiments' .$dpath/OpenCOR -c CellMLTextView::export $tpath/$txtfile.txt | out-file $cpath/$txtfile.cellml -encoding utf8