-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfile.java
More file actions
41 lines (33 loc) · 1.2 KB
/
file.java
File metadata and controls
41 lines (33 loc) · 1.2 KB
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
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
public class file {
public static void main(String[] args) throws IOException {
File dir = new File(".");
//String source = dir.getCanonicalPath() + File.separator + "Code.txt";
//String dest = dir.getCanonicalPath() + File.separator + "Dest.txt";
File fin = new File("C:/Users/Praveen Chandanala/Desktop/apk/calc/AndroidManifest.xml");
FileInputStream fis = new FileInputStream(fin);
BufferedReader in = new BufferedReader(new InputStreamReader(fis));
FileWriter fstream = new FileWriter("C:/Users/Praveen Chandanala/Desktop/apk/calc/kaki.txt");
BufferedWriter out = new BufferedWriter(fstream);
String aLine = null;
while ((aLine = in.readLine()) != null) {
//Process each line and add output to Dest.txt file
if(aLine.startsWith(" <uses-permission"))
{
out.write(aLine);
out.newLine();
}
}
// do not forget to close the buffer reader
in.close();
// close buffer writer
out.close();
}
}