-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHTMLGenerator.java
More file actions
32 lines (29 loc) · 1 KB
/
HTMLGenerator.java
File metadata and controls
32 lines (29 loc) · 1 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
import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;
public class HTMLGenerator {
public static void main(String[] args) {
// Arquivo de entrada e saída
String inputFile = "input.txt", outputFile = "output.html";
File fileHTML = new File(outputFile), fileInput = new File(inputFile);
try {
Scanner s = new Scanner(fileInput);
PrintWriter pw = new PrintWriter(fileHTML);
TAGController tc = new TAGController(pw);
tc.init();
while(s.hasNextLine()){
String[] dados = s.nextLine().split(" ");
for(String dado : dados){
if(tc.defineTAG(dado)){
tc.abreTAG();
continue;
}
tc.insereDado(dado);
}
tc.fechaTAG();
}
tc.close();
} catch (Exception e) {
}
}
}