In sequence recognition, multiple pattern strings need to be identified, and multiple-line floating-point numbers need to be read and parsed.
So the method used is:
Use text to read multiple lines, regular expression matches for each line of text, and character conversions.
The code is as follows:
@SuppressLint ("Sdcardpath") public static void Readtxt2seqmulti (String txtpath, vector<vector<float > > Seq) { & nbsp; try { string encoding= "GBK"; file file=new File (Txtpath); if (file.isfile () && File.exists ()) {//Determine whether the file exists & nbsp inputstreamreader read = new InputStreamReader ( & nbsp; new fileinputstream (file), encoding); Considering the coding format bufferedreader bufferedreader = new BufferedReader (read); string linetxt = Null
seq.clear (); while (linetxt = Bufferedreader.readline ())!= null) { & nbsp; //input each line to the vector //system.out.println (linetxt); string[] Sourcestrarray = Linetxt.split ("");
Vector<float > seqs= New Vector<float > (); for (int i = 0; i < sourcestrarray.length i++) { //system.out.println (sourcestrarray[i)
);
string svalue = sourcestrarray[i]; float Value =float.parsefloat (svalue);
seqs.add (Value); } & nbsp
Seq.add (SEQS);  } & nbsp; read.close (); }else{ & nbsp; system.out.println ("No specified file found");    } & nbsp &NBSP} catch (Exception e) { SYSTEM.OUT.PRINTLN ("Error reading file contents"); e.printstacktrace (); }