Opened 4 years ago

Closed 4 years ago

#2070 closed defect (done)

TableFilesParser does not parse correctly

Reported by: sforsten Owned by: mkommend
Priority: medium Milestone: HeuristicLab 3.3.9
Component: Problems.Instances Version: 3.3.8
Keywords: Cc:

Description

TableFilesParser does not parse doubles with the exponential format specifier correctly. Additionally, it does not always correctly determine if the first line contains the variable names.

Change History (11)

comment:1 Changed 4 years ago by sforsten

  • Status changed from new to accepted

r9608:

  • changed parse methods in TableFileParser to accept a bool which defines, if the first line contains variable names
  • added methods in TableFileParser to check if the first line contains variable names
  • adapted unit tests
  • adapted DataAnalysisImportTypeDialog so that a checkbox can be set to define if the first line contains variable names
  • added the flag NumberStyles.AllowTrailingSign for parsing doubles

comment:2 Changed 4 years ago by sforsten

  • Owner changed from sforsten to mkommend
  • Status changed from accepted to reviewing

comment:3 Changed 4 years ago by gkronber

Is it really necessary to support trailing signs ?

comment:4 follow-up: Changed 4 years ago by sforsten

  • Owner changed from mkommend to sforsten
  • Status changed from reviewing to assigned

r9610: corrected resource instance provider

If trailing signs are not supported, a format like '1.1419000e+002' cannot be parsed.

comment:5 Changed 4 years ago by sforsten

  • Owner changed from sforsten to mkommend
  • Status changed from assigned to reviewing

comment:6 in reply to: ↑ 4 Changed 4 years ago by gkronber

Replying to sforsten:

r9610: corrected resource instance provider

If trailing signs are not supported, a format like '1.1419000e+002' cannot be parsed.

AFAIK this is not true. Trailing sign means that I can write a negative / positive number in the following way: "5+" / "5-". So far I have never needed this but is is seemingly common in a FI / CO context.

For exponents you need AllowExponent

MSDN excerpt: "Indicates that the numeric string can be in exponential notation. The AllowExponent flag allows the parsed string to contain an exponent that begins with the "E" or "e" character and that is followed by an optional positive or negative sign and an integer. In other words, it successfully parses strings in the form nnnExx, nnnE+xx, and nnnE-xx. It does not allow a decimal separator or sign in the significand or mantissa; to allow these elements in the string to be parsed, use the AllowDecimalPoint and AllowLeadingSign flags, or use a composite style that includes these individual flags."

comment:7 Changed 4 years ago by mkommend

r9611: Removed flag NumberStyles.AllowTrailingSign in the TableFileParser.

comment:8 Changed 4 years ago by mkommend

  • Status changed from reviewing to assigned

r9623: Corrected anchors of error textbox in DataAnalysisImportDialog.

comment:9 Changed 4 years ago by mkommend

  • Status changed from assigned to accepted

r9624: Corrected changes made in r9623 to DataAnalysisImportTypeDialog designer file.

comment:10 Changed 4 years ago by mkommend

  • Status changed from accepted to readytorelease

comment:11 Changed 4 years ago by mkommend

  • Resolution set to done
  • Status changed from readytorelease to closed

r9651: Merged r9608, r9610, r9611, r9623, and r9624 in the stable branch.

Note: See TracTickets for help on using tickets.