Resulting from a previous bug in musrfit there exist many msr-files which have a huge number of empty lines at the end.

Files that are newly generated through msr2data from now on will only write two successive empty lines (at any occurence).
Any further empty lines will be deleted.
This commit is contained in:
Bastian M. Wojek 2010-12-14 16:33:05 +00:00
parent f6a3e31eee
commit 2735116ab7

View File

@ -513,6 +513,7 @@ bool PMsr2Data::PrepareNewInputFile(unsigned int tempRun) const
string line, firstOnLine;
istringstream strLine;
unsigned int emptyLineCounter(0);
// write the run number in the TITLE line of the msr-file (is overwritten later by musrfit if called with the -t option)
getline(in, line);
@ -520,9 +521,12 @@ bool PMsr2Data::PrepareNewInputFile(unsigned int tempRun) const
while (getline(in, line)) {
if (line.empty()) {
out << endl;
if (++emptyLineCounter < 3) // allow only two successive empty lines in the input files (just for convenience)
out << endl;
continue;
}
} else
emptyLineCounter = 0;
if (!line.compare("SET BATCH") || !line.compare("END RETURN"))
continue;