forked from omerbsezer/CNN-TA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Phase0.java
61 lines (43 loc) · 1.34 KB
/
Phase0.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
57
58
59
60
61
package ml.cnn.paper;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import org.apache.commons.io.input.ReversedLinesFileReader;
public class Phase0 {
public static String outputFilePath;
public static void PhaseProcess(String inputFilePath, String outputFile) throws Exception{
//String strpath="resources2/APPL19972007.csv";
//String strpath="resources2/APPL20072017.csv";
String strpath=inputFilePath;
ReversedLinesFileReader fr = new ReversedLinesFileReader(new File(strpath));
String ch;
int time=0;
String Conversion="";
PrintWriter writer = new PrintWriter("resources3/reverseFile"+outputFile+".csv", "UTF-8");
do {
ch = fr.readLine();
System.out.println(ch);
if(ch != null)
writer.println(ch);
} while (ch != null);
writer.close();
fr.close();
}
public static void main(String[] args) throws Exception {
String strpath="resources3/AXP19972007.csv";
//String strpath="resources3/CAT20072017.csv";
ReversedLinesFileReader fr = new ReversedLinesFileReader(new File(strpath));
String ch;
int time=0;
String Conversion="";
PrintWriter writer = new PrintWriter("resources3/reverseFile.csv", "UTF-8");
do {
ch = fr.readLine();
System.out.println(ch);
if(ch != null)
writer.println(ch);
} while (ch != null);
writer.close();
fr.close();
}
}