f# - Generate reports for all invalid data - Csv file data type validation? -


the following code defined schema of csv file , used load lot csv files. however, there data error, example, date not in correct format, missing data required fields, etc. how generate reports files using schema invalid data. , load executed if there no error.

type mycsvtype = csvprovider<schema = "a (int), b (string), c (date)", hasheaders=true> mycsvtype.load(myfile) // execute when there no data error 

a proposed error report example:

   rows missing values: 20, 40, 60, ...   rows invalid values: 30(nan), 31(xyz), .... b c   rows invalid values: 200 (2015q1), .... 

there no built-in support - 1 option have explicitly make types of columns optional , check none values in data set. way, can list of rows missing or no data:

type mycsvtype = csvprovider<schema="a (int option), b (string option), c (date option)", hasheaders=false>  let c = mycsvtype.parse(""", hi, 1/1/2001 1, hi, foo""")  printfn "rows missing/invalid values a:" c.rows |> seq.iteri (fun v ->   match v.a   | _ -> ()   | none -> printfn "  %d" i) 

unfortunately, don't think there way invalid value in case when parsing fails. please open issue discuss how supported!


Comments

Popular posts from this blog

Java 3D LWJGL collision -

methods - python can't use function in submodule -

c# - ErrorThe type or namespace name 'AxWMPLib' could not be found (are you missing a using directive or an assembly reference?) -