-7

Is there any solution to parse a java manifest (manifest.mf) file in C#?

I need to get values from it.

Thank you very much!

P.J.Meisch
  • 18,013
  • 6
  • 50
  • 66
user1692315
  • 129
  • 3
  • 10
  • 5
    Have you even tried *anything*? Parsing a simple text-file is quite standard-stuff and you should be able to google it and find dozens of examples (not neccessarily for manifest-files but you´ll get the idea). – MakePeaceGreatAgain May 15 '17 at 09:00
  • I just googled out of curiosity. Looks so trivial compared to xml. Should be easy – Aluan Haddad May 15 '17 at 09:06
  • As I see, it's not follows any convention, of course I can do it, with string-manipulation, but I believed there is a standard solution to parse it, like xml or json... In Java, as I saw, there is a class for parsing this file. I tried to analyze the structure of it, but for me, it's really unclear. – user1692315 May 15 '17 at 09:11

1 Answers1

0

I doubt that there's a C# Specific library for this, but this question (Use of the MANIFEST.MF file in Java) has a great overview of the file, what it's for, and a lot of other helpful information.

That being said, the quick and dirty way (in my opinion) for how to do this would be split every line by a colon, the first value in the array is the header name, and all other values after that, would be the value. (just in case your value has a colon in it, I'm unsure if that's allowed by the spec or not but, but I'd assume so.

Community
  • 1
  • 1
Zachary Craig
  • 2,192
  • 4
  • 23
  • 34