I am completely new to LINQ and I want to learn it's usefulness in parsing text files, instead of using a scripting language such as Perl or Ruby. I have generated a long list delimited by "CR" and "LF" and I would like to create a .CSV file to export to Excel containing only the first three lines. Example:
[CR][LF]
Field: Microsoft.VSTS.Build.FoundIn[CR][LF]
Name: Found In[CR][LF]
Type: String[CR][LF]
Use: Test project[CR][LF]
Indexed: False[CR][LF]
Reportable As: dimension[CR][LF]
Synchronizes Identity Name Changes: False[CR][LF]
[CR][LF]
Field: Microsoft.VSTS.Build.IntegrationBuild[CR][LF]
Name: Integration Build[CR][LF]
Type: String[CR][LF]
Use: Test project[CR][LF]
Indexed: False[CR][LF]
Reportable As: dimension[CR][LF]
Synchronizes Identity Name Changes: False[CR][LF]
[CR][LF]
(the list goes on)
Desired output:
"Microsoft.VSTS.Build.FoundIn","Found In","String"
"Microsoft.VSTS.Build.IntegrationBuild","Integration Build","String"
How can I write this in LINQ the simplest way possible?