I have a kind of csv file, with some extra parameters. I don’t want to write my own parser since I know there are alot of good ones out there. The problem is that I’m unsurtan if there is any parser that could handle my scenario.
My csv file looks like this:

I would like to first read the second lines below # ADM so in this case 3 lines. And the I would like to read the second line after # Prov.
Is there any good parser or reader that I could use that would help me with this, and how would I write to handle my scenario?
The extension of my file is not .csv either, it’s .lab , but I guess thats not going to be a problem ?
Fore, I didn’t see a spefic language for the task, and read too late about
c#. Here is aperlsolution, but is well commented, so I hope it can be useful and easy to translate to other languages.Assuming a test file (
infile) like:Content of
script.pl:Run it like:
With following output: