From d6933bae59b47b1f31a757f2eed08338ce78f6f5 Mon Sep 17 00:00:00 2001 From: "Bastian M. Wojek" Date: Thu, 15 May 2008 21:39:01 +0000 Subject: [PATCH] The names of the datafiles are handled a bit more flexible now --- src/external/scripts/mlog2db | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/external/scripts/mlog2db b/src/external/scripts/mlog2db index 283e0c12..f9a22b97 100755 --- a/src/external/scripts/mlog2db +++ b/src/external/scripts/mlog2db @@ -37,8 +37,7 @@ template for the first musrfit input file. The results of the fits will be writt CAUTION: The "indexing number" of the .mlog has to be at the beginning of the filename. -Furthermore the data files that were fitted have to have the name "XXX_RUN#[_YYY]", "ZZZ_his_RUN#" or "WWW_pta_VVV_RUN#", where -WWW,VVV,XXX,YYY,ZZZ are strings without whitespaces ("/" is OK). +Furthermore the data files that were fitted have to have the name "XXX_RUN#[_YYY]", where XXX,YYY are strings without whitespaces ("/" is OK). If you want to use the fitting feature, musrfit has to be installed either on the PATH or in the working directory. @@ -216,9 +215,19 @@ awk -v parFOUR=$4 -v parFIVE=$5 -v parSIX=$6 '{ dataArray[i+1] = $6 dataArray[i+2] = $9 - if(runNumber[2] == "his") {dataArray[i+3] = substr(runNumber[3],1,4) } - else if(runNumber[2] == "pta") {dataArray[i+3] = substr(runNumber[4],1,4)} - else {dataArray[i+3] = runNumber[2] } + for (j in runNumber) { + if ( runNumber[j] ~ /^0/ ) { + sub(/0+/, "", runNumber[j]) + } + if (int(runNumber[j]) == runNumber[j]) { + dataArray[i+3] = runNumber[j] + break + } + } + +# if(runNumber[2] == "his") {dataArray[i+3] = substr(runNumber[3],1,4) } +# else if(runNumber[2] == "pta") {dataArray[i+3] = substr(runNumber[4],1,4)} +# else {dataArray[i+3] = runNumber[2] } negErrArray[i] = "" negErrArray[i+1] = ""