My Text file Contains line like this
FLTR TID: 0000003756 RPC ID: 0000108159 USER: Remedy Application Service
FLTR TID: 0000003756 RPC ID: 0
public class UniqueUSER {
static HSSFWorkbook hwb=new HSSFWorkbook();
static HSSFSheet sheet = hwb.createSheet("new sheet");
public static void main(String[]args) throws IOException
{
HSSFRow row;
HashSet names = new HashSet<>();
BufferedReader br=new BufferedReader(new FileReader("simle.log"));
PrintStream out=new PrintStream("D:/Excel.xls");
String str=null;
int count=0;
while((str=br.readLine())!=null) {
if(str.contains("FLTR"))
{
String user=str.substring(97, 135);
count++;
names.add(user);
HSSFRow row1= sheet.createRow((short)count);
row1.createCell((short) 0).setCellValue("names");
}
}
Iterator itr=names.iterator();
while(itr.hasNext()) {
out.println(itr.next());
}
}
}