In response to your comment:
@JBD: not only why, but also how. Indeed I can't see any issue comparing my question with the checklist. – Giacomo Tesio 7 mins ago
Let us take a careful look at your question:
I have a file containing data produced by string.Format(), one per line, something like:
Class1 [ Property1 = 123, Property2 = 124 ]
Class2 [ Property4 = 'ABCD', Property5 = 1234, Property6 = 10 ]
Class1 [ Property1 = 2, Property2 = 3 ]
Class2 [ Property4 = 'DEFG', Property5 = 2222, Property6 = 19 ]
and so on...
I need to parse them back to obtain the instances of the classes.
Given that I have the original string.Format template used to produce such lines, what's the fastest way to obtain back the original values so that I can build back the instances of
Class2 (for fast here I mean in terms developer's time)?
PS: I can rely on the fact that all input strings are "well formed" according to the template.
PPS: I know that using JSON would make this simpler, but right now I can't. Moreover I know Irony too, but I'm looking for something even faster (if possible).
And compare it to the checklist:
Have you done some research before asking the question?
Perhaps you have done some research on "the fastest way to obtain back the original values so that I can build back the instances of
Class2", but you've not shown any evidence that you've done so. From the reader's perspective, this first item would have to be: no.
Have you explained what you've already tried to solve your problem?
You've not shown any attempts you've already made to solve this problem. You've not included any research attempts (articles, etc) nor any code ("here's what I tried and it isn't working/is too slow/etc"). So again, no.
If your question doesn't include code, are you sure it shouldn't?
Since it's a question expecting code in the answer, it should almost certainly have code in the question. No.
Have you read the whole question to yourself carefully, to make sure it makes sense and contains enough information for someone coming to it without any of the context that you already know?
No. You clearly know a good bit about the topic, but based on user comments, there was a lot you didn't bother to say in your question.
It's hardly the worst question I've ever seen, but there are several ways you could fix this. In the end, it comes off sounding like you want someone to hand you a solution (meaning, give you code you haven't written yet) rather than help you fix a problem (with code you've already written).
Keep these general rules in mind:
If you want code in the answers, you should have code in the question
Ask questions about code you've already written. Post that code (or some slimmed down version of it) and explain, in detail, what's wrong with it. If it's too slow, provide a theory as to why. If it won't compile, include the complete error message. Etc.
Or, think of it like ordering a drink:
I want a Woodford Reserve, neat
We know exactly what you want, and we can come up with a good solution for you (we don't have Woodford, but Chattanooga Whiskey is similar)
I want something sweet
Um... would you like a milkshake?
"No, I'm lactose intollerant."
Oh, okay. How about a soda?
"No, I don't like bubbles."
Umm... would you like to look at the menu some more and I can come back in a few minutes?