how to catch double values from formatted text file in c# -


i want extract data excell file , edit fields , save in db excell file contains values alpha=10e-4 , beta=10e-4 want save example alpha , beta values in separate fields , store theme in double format how doing this: example if string file rr="alpha=10e-4 , beta=10e-4"

string alpha=""; string beta=""; alpha=rr.substring(0,indexof(",")+1); alpha=alpha.replace("alpha=",""); alpha=alpha.replace(" , ",""); double alpha=convet.todouble(alpha); 

i pretty sure way not clever way of extracting values text file, , may not work when add space or how can this? parallels?

using regular expressions, first, read file string variable , pass regex.matches:

var input = file.readalltext(path); var matches = regex.matches(input, @"(\d+e\-\d)");  foreach (var match in matches) { } 

Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -