-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFilemast.java
56 lines (48 loc) · 1.6 KB
/
Filemast.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package filemast;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
/**
*
* @author Snehal
*/
public class Filemast {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws FileNotFoundException, IOException {
// TODO code application logic here
int cnt=0;
FileWriter fw = new FileWriter("J:\\Agos\\Start all over\\klacfasta.txt");
BufferedWriter bw = new BufferedWriter(fw);
String y="",line;
FileReader fr1 = new FileReader("J:\\Agos\\Start all over\\Combotf.txt");
BufferedReader br1 = new BufferedReader(fr1);
while((line=br1.readLine())!=null)
{
y = y+line.split(" ")[0]+" ";
}
//System.out.println(y);
FileReader fr2 = new FileReader("J:\\Agos\\Start all over\\Common\\klaccommon.txt");
BufferedReader br2 = new BufferedReader(fr2);
while((line=br2.readLine())!=null)
{
String[] t = line.split(" ");
if(y.contains(t[1])||y.contains(t[2]))
{
bw.write(line+"\n");
cnt++;
}
}
System.out.println(cnt);
bw.close();
}
}