Html to Txt in C++

  
October 21
Html to Txt in C++
convert html to txt
html parser
C++;
本程序可以用来处理spider爬下来的网页,提取其文本,去除html的tag;
本程序用于批量转换某个文件夹下面所有的html文件;
 
程序总共分为2部分,一部分是列出该文件夹下所有的文件( 用C++遍历一个文件夹下面所有的文件 Zz)
另一方面是将html转换为txt
 
 
  1. October 21
  2. Html to Txt in C++
  3. convert html to txt
  4. html parser
  5. C++;
  6. 本程序可以用来处理spider爬下来的网页,提取其文本,去除html的tag;
  7. 本程序用于批量转换某个文件夹下面所有的html文件;

  8. 程序总共分为2部分,一部分是列出该文件夹下所有的文件(用C++遍历一个文件夹下面所有的文件 Zz)
  9. 另一方面是将html转换为txt

  10. 点击此处下载完整版本



  11. --------------------------------------------------------------------------------

  12. /*
  13. This code is to convert all html documents under c:/WT2G/ into text documents
  14.   Reference class ffsco and Html2txt codes;
  15.   By Super.jiju
  16.   super.jiju@gmail.com
  17.   super-jiju.spaces.live.com
  18.   Oct 22,2008;
  19. */
  20. #include <stdio.h>
  21. #include <stdlib.h>
  22. #include <windows.h>
  23. #include <locale.h>
  24. #include <string>
  25. #include "ffsco.h"
  26. void UnicodeToGB2312(char* pOut,unsigned short uData)
  27. {
  28.  WideCharToMultiByte(CP_ACP,NULL,&uData,1,pOut,sizeof(WCHAR),NULL,NULL);
  29.  return;
  30. }

  31. #define BUFSIZE 1024*1024*2
  32. char buf[1024*1024*20];
  33. char shadowbuf[1024*1024*20];
  34. char buffer[BUFSIZE];
  35. long size;
  36. int
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值