catch incomplete rows and fill them with empty string[s]

This commit is contained in:
2022-10-15 14:15:36 +02:00
parent 4ec6ccd0fd
commit 752406815c
3 changed files with 44 additions and 6 deletions

View File

@@ -105,6 +105,12 @@ func parseFile(input io.Reader, pattern string) (Tabdata, error) {
idx++
}
// fill up missing fields, if any
for i := len(values); i < len(data.headers); i++ {
values = append(values, "")
}
data.entries = append(data.entries, values)
}
}