Skip to content

Commit 5a47680

Browse files
committed
fixed parsing of trailing comma and pkg
1 parent fcc003d commit 5a47680

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

dist/mojo_csv.mojopkg

1.83 KB
Binary file not shown.

src/csv_reader.mojo

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ struct CsvReader[]:
9393
if pos + 1 < self.length:
9494
self.row_count += 1
9595
col_start = pos + 1
96+
97+
elif pos == self.length:
98+
self.elements.append(self.raw[col_start:pos])
9699
# -------
97100
# -------------
98101

test.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
item1,item2,"ite,em3"
22
pic, pi c,pic,
3-
r_i_1,r_i_2,r_i_3,
3+
r_i_1,r_i_2,r_i_3,

0 commit comments

Comments
 (0)