導出微信群中的聯系人的備注


package de.bvb;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;

/**
 * 導出微信群中的聯系人的備注
 * 1.登錄微信web版本:     https://wx2.qq.com/
 * 2.選擇一個群,然后點右邊的V字箭頭把人顯示出來,隨便點一個人,右鍵,選擇檢查

 * 3.鼠標滑動到最上面第二行(<html lang="zh_CN">),右鍵"edit as html"
                然后全選,復制粘貼到一個文件中,比如C:/Users/Administrator/Desktop/wechat/2.txt
                
*/
public class Test1 {

    public static final String fileFullPath = "C:/Users/Administrator/Desktop/wechat/2.txt";
    public static final String startsWith = "            <p class=\"nickname ng-binding\" ng-bind-html=\"";
    public static final String replace_left = "            <p class=\"nickname ng-binding\" ng-bind-html=\"getUserContact(item.UserName,currentContact.UserName).getDisplayName(currentContact.UserName)\">";
    public static final String replace_right = "</p>";

    public static void main(String[] args) throws Exception {
        File file = new File(fileFullPath);

        //        InputStreamReader read = new InputStreamReader(new FileInputStream(file), "utf-8");//考慮到編碼格式
        InputStreamReader read = new InputStreamReader(new FileInputStream(file));
        BufferedReader bufferedReader = new BufferedReader(read);
        String lineTxt = null;
        int counts = 0;
        while ((lineTxt = bufferedReader.readLine()) != null) {
            if (lineTxt.startsWith(startsWith)) {
                ++counts;
                System.out.println(lineTxt.replace(replace_left, "").replace(replace_right, ""));
            }
        }
        System.out.println("總人數:" + counts);
        read.close();
    }
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM