In VB.net I’m trying to read in a specific line from a file. An example of the line in the txt file is:
[PATH] = "/this/directory/run.exe"
Now I understand how to open the file for reading and writing in VB, but I need to parse out the path in the “” (quotation marks). Any help would be greatly appreciated!!
–Adam
Finding the line depends on what its distinguishing features are, but basically the idea would be to use LINQ. For example:
This gets you the first line that begins with “[PATH]”. If you need better discrimination you could use a more sophisticated match such as a regex.
You can then extract the path from the line as per Rubens’ or SLaks’ answers.