How to parse the line of text :
File.txt:
n:96 pts:341998 pts_time:3.79998 pos:-1 fmt:yuvj420p sar:12/11
and just get the time value appearing after pts_time
.
Expected Output :
3.79998
How to get the expected output?? Any help would be really appreatiated.
Split n:96 pts:341998 pts_time:3.79998 pos:-1 fmt:yuvj420p sar:12/11
with Space.
string[] lineParts = line.Split(" ".ToCharArray());
Get the array element which matches pts_time
key.
string ptsTime = lineParts.First(p => p.StartsWith("pts_time")); // pts_time:3.79998
Split the ptsTime
with :
string ptsTimeValue = ptsTime.Split(':')[1]; // 3.79998