特定用户QQ群聊天记录导出的实现

一、把QQ群的聊天记录txt格式导出

消息管理器 -> 选择要导出的群 -> 右击、导出
这里要注意 : 导出之后的 文本是 unicode 编码的,需要转换 ==|| 之前不知道,搞了大半天。
重新建一个txt , 把原来的 txt 内容 复制 到 新的 txt ,保存就行了。

二、详细代码

1. head.h

 1 #ifndef TxtSearch
 2 #define TxtSearch
 3 
 4 #include<string>
 5 #include<map>
 6 #include<set>
 7 #include<iostream>
 8 #include<vector>
 9 #include<fstream>
10 #include<sstream>
11 #include<ctype.h>
12 
13 typedef unsigned char BYTE;
14 typedef unsigned short WORD;
15 
16 bool IsChineseChar(WORD DoubleByte);
17 
18 void WordAndChar_print(std::string );
19 
20 
21 class TextQuery
22 {
23 public:
24 
25     typedef std::vector<std::string>::size_type line_no;
26 
27     void read_file(std::ifstream & );
28     std::set<line_no> run_query(const std::string&) const;
29     std::string text_line(line_no) const;
30 private:
31     void store_file( std::ifstream &  );
32     void build_map();
33 
34 
35     std::vector<std::string> lines_of_text;
36     std::vector<std::string> bak_lines_of_text;
37     std::map< std::string,std::set<line_no> > word_map;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小爷毛毛(卓寿杰)

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值