package com.it.aron;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
/**
* check repetitive text
* @author: aronxu
* @version: 1.0, Sep 22, 2015
*/
public class AutoCheckText {
private static final String FILE_PATH = "D:/text1.txt";
private static final String COMPARED_FILE_PATH = "D:/text2.txt";
private static final String RESULT_FILE_PATH = "D:/result.txt";
public static void main(String[] args) {
System.out.println("======Start Search!=======");
long startTime = System.currentTimeMillis();
// Read first file
File file = new File(FILE_PATH);
File comparedFile = new File(COMPARED_FILE_PATH);
BufferedReader br = null;
BufferedReader cbr = null;
BufferedWriter rbw = null;
try {
br = new BufferedReader(new FileReader(file));
cbr = new BufferedReader(new FileReader(comparedFile));
cbr.mark(90000000);
rbw = new BufferedWriter(new FileWriter(RESULT_FILE_PATH));
String lineText = null;
while ((lineText = br.readLine()) != null) {
String searchText = lineText.trim();
searchAndSignProcess(searchText, cbr, rbw);
}
long endTime = System.currentTimeMillis();
System.out.println("======Process Over!=======");
System.out.println("Time Spending:" + ((endTime - startTime) / 1000D) + "s");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (cbr != null && rbw != null) {
try {
cbr.close();
rbw.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
}
public static void searchAndSignProcess(String searchText, BufferedReader comparedReader, BufferedWriter rbw)
throws IOException {
String lineStr = "-n";
if (searchText == null) {
return;
}
if ("".equals(searchText)) {
rbw.write(lineStr);
return;
}
String lineText = null;
int lineNum = 1;
while ((lineText = comparedReader.readLine()) != null) {
String comparedLine = lineText.trim();
if (searchText.equals(comparedLine)) {
lineStr = "###=Equal:" + lineNum + "=###n";
break;
}
lineNum++;
}
rbw.write(lineStr);
comparedReader.reset();
}
}
myaccount.msg.register.register=Registro Personas myaccount.msg.register.your_company=¿Eres empresa? myaccount.msg.register.sign_up=Registrate aquí myaccount.msg.register.fields_compellent=Todos los campos son obligatorios myaccount.msg.register.account_data=Datos de la cuenta myaccount.msg.register.email=E-mail: myaccount.msg.register.confirm_email=Confirma tu E-mail: myaccount.msg.register.password=Contraseña: myaccount.msg.register.confirm_password=Confirma tu Contraseña: myaccount.msg.register.personal_data=Datos personales myaccount.msg.register.first_name=Nombre: myaccount.msg.register.last_name=Apellido Paterno: myaccount.msg.register.middle_name=Apellido Materno: myaccount.msg.register.country=País de Residencia: myaccount.msg.register.id_card=Cédula de Identidad: myaccount.msg.register.genero=Género: myaccount.msg.register.male=Masculino: myaccount.msg.register.female=Femenino: myaccount.msg.register.birth=Fecha de Nacimiento: myaccount.msg.register.day=Día myaccount.msg.register.month=Mes
myaccount.msg.register.country=País de Residencia: myaccount.msg.register.confirm_password=Confirma tu Contraseña: myaccount.msg.register.last_name=Apellido Paterno: myaccount.msg.register.middle_name=Apellido Materno: myaccount.msg.register.id_card=Cédula de Identidad: myaccount.msg.register.genero=Género: myaccount.msg.register.male=Masculino: myaccount.msg.register.female=Femenino: myaccount.msg.register.personal_data=Datos personales myaccount.msg.register.first_name=Nombre:
- - - - - - - - - ###=Equal:2=### ###=Equal:12=### ###=Equal:13=### - ###=Equal:4=### ###=Equal:5=### ###=Equal:1=### ###=Equal:7=### - ###=Equal:9=### ###=Equal:10=### ###=Equal:11=### - - -
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有