Package test; import Java. io. bufferedreader; import Java. io. file; import Java. io. fileinputstream; import Java. io. inputstreamreader; /*** @ author javaalpha 02:06:27 utf8 TXT file garbled Processing */public class qqgroup {/*** @ Param ARGs */public static void main (string [] ARGs) {readtxt ();} Private Static void readtxt () {try {file F1 = new file ("E:/qqgroup.txt"); // open the file fileinputstream in = new fileinputstream (F1); // specify to read bufferedreader in UTF-8 format when reading a file BR = new bufferedreader (New inputstreamreader (in, "UTF-8 ")); // read the file string name = ""; string numb = ""; string STR; system. out. println ("group name ************** group number"); While (STR = BR. readline ())! = NULL) {If (Str. indexof ("class = \" addrtitle \ ">")>-1) {name = Str. substring (Str. indexof (">"), str. indexof ("</"); system. out. println ("group name:" + name);} If (Str. indexof ("gid =")>-1) {numb = Str. substring (Str. indexof ("gid ="), str. indexof ("@ groupmail"); system. out. println ("group number:" + numb) ;}} in. close (); // close read} catch (exception E1) {// if an error occurs, handle e1.printstacktrace () here; // print the error message }}}