I have a text data file which contains text like this:
"[category.type.group.subgroup]" - "2934:10,4388:20,3949:30" "[category.type.group.subgroup]" - "2934:10,4388:20,3949:30" "[category.type.group.subgroup]" - "2934:10,4388:20,3949:30" "[category.type.group.subgroup]" - "2934:10,4388:20,3949:30" 34i23042034002340 ----- "[category.type.group.subgroup]" - "2934:10,4388:20,3949:30" "[category.type.group.subgroup]" - "2934:10,4388:20,3949:30" 828728382 ------ 3498293485 AAAAAAA
I need the best way to parse the data, specifically I need the category, type, group, subgroup, and numeric values in the quotes. I was thinking of using Regex, but I was wondering if there are other ideas instead of having several IF statements to analize the data?
Try the FileHelpers library, it’ll take a little work to set up, but save you a lot of work dealing with all the tricky situations that come up in parsing a file like that. It can handle delimited, fixed-width or record based parsing.