Hello all,
This is a program I wrote in java to check the client files for for gem descriptions.
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class StringArraySearch {
public static void main(String[] args) throws IOException{
//Creation of File Descriptor for input file
File readFile = new File("src/stonehint.txt");
//Intialize the word Array
String[] fileWords=null;
//Creation of File Reader object
FileReader fr = new FileReader(readFile);
//Creation of BufferedReader object
BufferedReader br = new BufferedReader(fr);
String stringCheck;
String[] input={
"ItemHint_LieYanS", "ItemHint_ZhiYanS", "ItemHint_HuoYaoS", "ItemHint_MaNaoS", "ItemHint_HanYu",
"ItemHint_YueZhiX", "ItemHint_ShuiLingS", "ItemHint_ShengGuangS", "ItemHint_FengLingS", "ItemHint_YingYanS",
"ItemHint_YanVitS", "ItemHint_YanStrS", "ItemHint_LongZhiTong", "ItemHint_LongZhiHun", "ItemHint_LongZhiXin",
"ItemHint_GaNaZhiShen", "ItemHint_HuangYu", "ItemHint_ChiYu", "ItemHint_QingYu", "ItemHint_XTLingGuang",
"ItemHint_LKBiZhong", "ItemHint_BBDuoShan", "ItemHint_FFDiYu", "ItemHint_XKQiangHua", "ItemHint_SShuiyao",
"ItemHint_SSbusi", "ItemHint_SSguangmang", "ItemHint_SSningju", "ItemHint_SSxuanwu", "ItemHint_HLS",
"ItemHint_HYS", "ItemHint_HJS", "ItemHint_BLS", "ItemHint_BYS", "ItemHint_BJS", "ItemHint_CLS",
"ItemHint_CYS", "ItemHint_CJS", "ItemHint_ZLS", "ItemHint_ZYS", "ItemHint_ZJS", "ItemHint_QLS",
"ItemHint_QYS", "ItemHint_QJS", "ItemHint_GGR", "ItemHint_GGS", "ItemHint_GGOS", "ItemHint_GGC", "ItemHint_GGW",
"ItemHint_JinYanS", "ItemHint_MuYanS", "ItemHint_ShuiYanS", "ItemHint_HuoYanS", "ItemHint_TuYanS"
};
//Variable to check increments
int count=0;
//Reading Content from the file
while((stringCheck = br.readLine())!=null){
//Split the word using space
fileWords = stringCheck.split(" ");
for (String word : fileWords){
for (int i = 0; i < input.length; i++){
//Search for the given word
if (word.equals(input[i])){
System.out.println(input[i] + " is present in the file");
count++;
}
}
}
}
System.out.println("");
System.out.println("There are "+count+" gem descriptions in the file");
fr.close();
}//close main method
}//class
How useful is it?
Not very lol.