Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class FileData {
- public static void main(String[] args) {
- String file_name = "C:/Users/dhamilton/Documents/20160816 test flight/this one.txt";
- String[] delimiter = new String[256];
- String[] labels = new String[256];
- for (int j = 0; j < 256; j++) {
- String hex = Integer.toHexString(j);
- delimiter[j] = "0x10, 0x41, 0x" + hex;
- String oct = Integer.toOctalString(j);
- labels[j] = oct;
- }
- try {
- ReadFile file = new ReadFile(file_name);
- String[] aryLines = file.OpenFile();
- //String sure = Integer.toBinaryString(i); //FIX THIS
- //System.out.println(sure);
- for (int i=0; i<aryLines.length; i++) {
- //System.out.println(aryLines[i].length() + "\t" + aryLines[i]);
- for (int p=0; p<255; p++) {
- if (aryLines[i].contains(delimiter[p])) {
- file.addOne(p);
- }
- }
- }
- for (int q=0; q<256; q++) {
- if (file.getCounter(q) != 0) {
- System.out.println("Label " + labels[q] + ":\t" + file.getCounter(q));
- }
- }
- }
- catch (IOException e) {
- System.out.println(e.getMessage());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement