Reorganize some code and add the start of the transport file parsing

This commit is contained in:
Alex Selimov 2026-03-28 22:56:36 -04:00
parent d5ed4c7599
commit 3548d8b449
7 changed files with 281 additions and 28 deletions

14
src/properties/utils.rs Normal file
View file

@ -0,0 +1,14 @@
pub fn parse_fields(line: &str, widths: &[usize]) -> Vec<String> {
let mut fields = Vec::new();
let mut pos = 0;
for &width in widths {
if let Some(field) = line.get(pos..pos + width) {
// The replace changes the fortran formatted D exponential for the normal E exponential
fields.push(field.trim().replace("D", "E").replace("E ", "E"));
}
pos += width;
}
fields
}