You are going to have to use a StringTokenizer object to seperate your input into tokens then setting each token into a string and using the Double.parseDouble("the double in string format"); then you would add it to the vector. StringTokenizer tokenizer = new StringTokenizer(line); String aWord; while((aWord= tokenizer.nextToken())!=null){ double myNumber = Double.parseDouble(aWord); vector.add(myNumber); }