www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - How to fix issue#10636 ?

reply Aditya <2022bel013 sggs.ac.in> writes:
hi everyone i am working on this issue
import std.array;
import std.csv;

void main()
{
	"foo\n1\n".csvReader.array[0].array;
}
error
std.csv.CSVException .../include/dmd/std/csv.d(1401): Row 2's 
length 0 does not match previous length of 1.
----------------
??:? pure  safe void std.csv.CsvRecord!(immutable(char)[], 1, 
immutable(char)[], dchar).CsvRecord.popFront() [0x45600e]
??:? pure  safe immutable(char)[][] 
std.array.array!(std.csv.CsvRecord!(immutable(char)[], 1, 
immutable(char)[], 
dchar).CsvRecord).array(std.csv.CsvRecord!(immutable(char)[], 1, 
immutable(char)[], dchar).CsvRecord) [0x468666]
??:? _Dmain [0x45487a]
could abyone suggest proper fix for this issue
it would be great help as i am stuck on this issue from long time
Mar 16
next sibling parent novicetoo <sorryno em.ail> writes:
may be Malformed.ignore option can help (but price is ignoring 
other format errors)
look https://dlang.org/phobos/std_csv.html
Mar 16
prev sibling parent Jordan Wilson <wilsonjord gmail.com> writes:
On Sunday, 16 March 2025 at 23:54:58 UTC, Aditya wrote:
 hi everyone i am working on this issue
 import std.array;
 import std.csv;

 void main()
 {
 	"foo\n1\n".csvReader.array[0].array;
 }
 error
 std.csv.CSVException .../include/dmd/std/csv.d(1401): Row 2's 
 length 0 does not match previous length of 1.
 ----------------
 ??:? pure  safe void std.csv.CsvRecord!(immutable(char)[], 1, 
 immutable(char)[], dchar).CsvRecord.popFront() [0x45600e]
 ??:? pure  safe immutable(char)[][] 
 std.array.array!(std.csv.CsvRecord!(immutable(char)[], 1, 
 immutable(char)[], 
 dchar).CsvRecord).array(std.csv.CsvRecord!(immutable(char)[], 
 1, immutable(char)[], dchar).CsvRecord) [0x468666]
 ??:? _Dmain [0x45487a]
 could abyone suggest proper fix for this issue
 it would be great help as i am stuck on this issue from long 
 time
`"foo\n1\n".csvReader.map!(a => a.array).front.array;` should work.
Mar 17