I've got a dictionary, i need to return the tvalue based on the search from a string array.
How do I return the tvalue for the tkey matching the string i'm searching for and the tvalue for the entry directly after it (to calculate the length of the entry.... this is so I can then access the original file and import the data).
parameters = a string array to be found.
The dictionary (dict) is setup as tkey = name, tvalue = bytes from the start of the file.
input 2 is the file with all the info in it.
foreach (var p in parameters)
{
if (dict.ContainsKey(p))
{
int posstart = //tvalue of the parameter found;
int posfinish = //tvalue ofnext entry ;
using (FileStream fs = new FileStream(input[2], FileMode.Open, FileAccess.Read))
{
byte[] bytes = //posstart to pos finish
System.Console.WriteLine(Encoding.Default.GetString(bytes));
}
}
else
{
Console.WriteLine($"error, {p} not found");
}
}
Any help is welcomed, Thank you in advanced.