From 61b91707cf760b458a2f43fb621b552d99549fb0 Mon Sep 17 00:00:00 2001 From: salman Date: Fri, 21 Apr 2023 15:38:53 +0200 Subject: [PATCH] Fix bug in producing fiels to download on web. --- TrimSPlib.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/TrimSPlib.js b/TrimSPlib.js index 157cc33..9170096 100644 --- a/TrimSPlib.js +++ b/TrimSPlib.js @@ -1424,9 +1424,22 @@ function startSequence() { } iScan++; } - - let seq_file = All["fileNamePrefix"]+"_Seq_Results.dat"; - + + let data = readAsciiFile(All["workPath"]+"/"+"fort.33"); + let LComp = ""; + let chem_formula = ""; + let place_holder = ""; + let re = new RegExp(place_holder,"g"); + for (let i=1;i<=All["numLayer"];i++) { + LComp = "L"+i+"Comp"; + chem_formula = All[LComp]; + place_holder = "impL"+i; + re = new RegExp(place_holder,"g"); + data = data.replace(re, chem_formula); + } + let seq_file = All["workPath"]+"/"+All["fileNamePrefix"]+"_Seq_Results.dat"; + writeAsciiFile(seq_file, data); + // Remove redundant files and change the name fort.33 if (!webOrApp) { // cmd="cd " + All["workPath"] + ";rm -f eingabe1.inp; mv -f fort.33 " + seq_file;