October 21
Html to Txt in C++
convert html to txt
html parser
C++;
本程序可以用来处理spider爬下来的网页,提取其文本,去除html的tag;
本程序用于批量转换某个文件夹下面所有的html文件;
程序总共分为2部分,一部分是列出该文件夹下所有的文件(
用C++遍历一个文件夹下面所有的文件 Zz)
另一方面是将html转换为txt
- October 21
- Html to Txt in C++
- convert html to txt
- html parser
- C++;
- 本程序可以用来处理spider爬下来的网页,提取其文本,去除html的tag;
- 本程序用于批量转换某个文件夹下面所有的html文件;
- 程序总共分为2部分,一部分是列出该文件夹下所有的文件(用C++遍历一个文件夹下面所有的文件 Zz)
- 另一方面是将html转换为txt
- 点击此处下载完整版本
- --------------------------------------------------------------------------------
- /*
- This code is to convert all html documents under c:/WT2G/ into text documents
- Reference class ffsco and Html2txt codes;
- By Super.jiju
- super.jiju@gmail.com
- super-jiju.spaces.live.com
- Oct 22,2008;
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include <windows.h>
- #include <locale.h>
- #include <string>
- #include "ffsco.h"
- void UnicodeToGB2312(char* pOut,unsigned short uData)
- {
- WideCharToMultiByte(CP_ACP,NULL,&uData,1,pOut,sizeof(WCHAR),NULL,NULL);
- return;
- }
- #define BUFSIZE 1024*1024*2
- char buf[1024*1024*20];
- char shadowbuf[1024*1024*20];
- char buffer[BUFSIZE];
- long size;
- int