-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFileGeneratorMain.java
74 lines (57 loc) · 1.83 KB
/
FileGeneratorMain.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
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* Author : Rakshit Shah
*/
package filegenerator;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.Formatter;
import java.util.Random;
/**
*
* @author nishant
*/
public class FileGeneratorMain {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int i,j;
// Random rn = new Random();
// int randn = 1+rn.nextInt(999999990);
// String I_S = Integer.toString(randn);
File file;
try{
for( i=0 ; i<=100; i=i+10){
for(j=0 ;j<=100 ; j=j+10)
{
String tempi = Integer.toString(i);
String tempj = Integer.toString(j);
//file = new Formatter("MINE_X_POINT_DETAILS_P_"+i+"_"+j+".csv");
file = new File("/home/icreate/data/drillfiles/MINE_X_POINT_DETAILS_P_"+i+"_"+j+".csv");
if (!file.exists()) {
file.createNewFile();
}
String content="";
for (int k=0;k<=100;k=k+10)
{
Random m = new Random();
Float randn;
randn = 5*m.nextFloat();
// String I_S = Integer.toString(randn);
content=content.concat(k+"|"+randn+"|null\n");
}
FileWriter fw = new FileWriter(file.getAbsoluteFile());
BufferedWriter bw = new BufferedWriter(fw);
bw.write(content);
bw.close();
}
}
System.out.println("Done");
}
catch(Exception ex){
System.err.println("Error");
}
}
}