Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- */
- package Assignment1;
- import javafx.application.Application;
- import javafx.stage.Stage;
- import java.io.BufferedReader;
- import java.io.FileNotFoundException;
- import java.io.FileReader;
- import java.io.FileWriter;
- import java.io.IOException;
- import java.lang.reflect.InvocationTargetException;
- import java.util.StringTokenizer;
- import java.math.BigInteger;
- import com.opencsv.CSVReader;
- /**
- * @author mike
- *
- */
- @SuppressWarnings({"restriction", "unused"})
- public class Dashboard extends Application {
- /* (non-Javadoc)
- * @see javafx.application.Application#start(javafx.stage.Stage)
- */
- private static String csvFile = "C:\\Users\\mike\\workspace\\Fall16-Lab1-BIDA\\src\\Assignment1\\property_tax_report.csv";
- private static String[] cols;
- private static String[] columnInformation;
- private static int lineNumber = 1;
- private static int tokenNumber = 0;
- private static int totalLenght = 0;
- private static BigInteger number;
- private static BigInteger calculatedNumber;
- private static BufferedReader reader;
- private static String strLine;
- private static StringTokenizer st = null;
- public static void getPropertyTax() throws IOException{
- try{
- reader = new BufferedReader(new FileReader(csvFile));
- }catch(FileNotFoundException exception){
- System.out.println(exception);
- }
- while ((strLine = reader.readLine()) != null){
- lineNumber++;
- cols = strLine.split(",");
- System.out.println("column 26 = " + cols[26]);//+ " , Column 27 = " + cols[27]);
- System.out.println("This has ran " + lineNumber + " times");
- if (cols[26] == "TAX_LEVY"){
- System.out.println("This is a string");
- }else{
- System.out.println("This row is " + lineNumber);
- System.out.println(cols[26]);
- columnInformation[0] = cols[26];
- }
- }
- for (int i = 0; i <= columnInformation.length; i++){
- number = new BigInteger(cols[26]);// BigInteger(cols[26]);
- calculatedNumber.add(number);
- totalLenght++;
- }
- calculatedNumber.divide(BigInteger.valueOf(totalLenght));
- System.out.println(calculatedNumber);
- }
- @Override
- public void start(Stage primaryStage) throws Exception {
- }
- public static void main(String args[]) throws IOException{
- // launch(args);
- getPropertyTax();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement