I have a custom file in which the data is included in the format as below
Prop1: value1 prop2: value2 prop3: value 2 table example 1 abcde10 11 12 13 14 12 13 11 12 20 table instances 2 xyz 1 3 4 3 4 0 table imports 3 prs 2 3 5 5 5 0
I want to be able to parse this file and map the contents of POCO. I was really excited to work with CSV type provider in F #, but then I quickly realized that it may not be possible to use it in my case. Do I have to write my own parser in this case?
>
If this is a file format, then I will just write the parser with hand. Divide the file into separate tables, headline and header, then throw each line at String.Split
and the resulting array parsed in specific record types for the table.
If that file format is more or less standardized and you expect that you will need to parse it more often and in different contexts (and / or you're feeling adventurous), you Always type your own type provider.
No comments:
Post a Comment