Better handling for DOS line endings in ASCII readers #5862
Labels
enhancement
New feature or request
impact medium
Productivity partially degraded (not easily mitigated bug) or improved (enhancement)
likelihood medium
Neither low nor high likelihood
low-hanging fruit
A cognizant developer has a shot at resolving in <1/2 day of work
reviewed
Issue has been reviewed and labeled by a developer
Is your feature request related to a problem?
We have many readers that read ascii files. We typically read them using STL
istream
objects. However, our parsing logic is not necessarily able to deal with DOS line endings (\r\n
) in all cases. We should audit and improve this situation. Instead of usingifstream::getline()
directly, we should use a VisIt defined wrapper method for this that detects such cases and removes the offending characters from whatever gets handed back to the plugin parsing logic.I encountered cases where NASTRAN reader was not behaving as expected with DOS line endings present. It was doing a ton of extra string to number conversion attempts on empty strings because it was failing to see the end of a line.
Is your feature request specific to a data set?
This is specific to ASCII file formats. Any such formats whose files are produced in Windows systems can have DOS line endings. We should be able to support them transparently.
Describe the solution you'd like.
Create a line reading method that ensures all plugin logic only ever sees "normal" line endings in strings read from files. This method can then be used to read files in all ASCII plugins.
Describe alternatives you've considered.
We could instead support a tool that removes DOS line endings from files. But, that seems less useful.
The text was updated successfully, but these errors were encountered: