Scel转txt
参考demo.java(如下代码),更换路径,根据需求按照注释运行即可
package com.enation.app.elasticsearch.scel;
import java.io.IOException;
public class Demo {
public static void main(String[] args) {
//单个scel文件转化 带拼音txt
FileProcessing scel=new SougouScelFileProcessing();
scel.parseFile("/Users/ST_iOS/Desktop/test/ciku/89个节日.scel",
"/Users/ST_iOS/Desktop/test/ciku/txt/89个节日.txt", true);
//带拼音的txt转成不带拼音的txt
// FileProcessing scel1=new TxtFileProcessing();
// scel1.parseFile("/Users/ST_iOS/Desktop/test/ciku/txt/89个节日.txt",
// "/Users/ST_iOS/Desktop/test/ciku/txt/89个节日没有拼音.txt", true);
//多个scel文件转化为一个txt (格式:拼音字母 词)
// try {
// scel.parseFiles("/Users/ST_iOS/Desktop/test/ciku",
// "/Users/ST_iOS/Desktop/test/ciku/txt/汇总.txt", false);
// } catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// //多个scel文件转化为多个txt文件
// scel.setTargetDir("/Users/ST_iOS/Desktop/test/ciku/多对多");//转化后文件的存储位置
// scel.parseFile("/Users/ST_iOS/Desktop/test/ciku",false);
}
}
其他附件:
FileProcessing.java:http://www.javamall.com.cn/enclosure/FileProcessing.java
SougouScelFileProcessing.java:http://www.javamall.com.cn/enclosure/SougouScelFileProcessing.java
SougouScelMdel.java:http://www.javamall.com.cn/enclosure/SougouScelMdel.java
TxtFileProcessing.java:http://www.javamall.com.cn/enclosure/TxtFileProcessing.java