Seems like you just need the double value present on each line and want to add it into a ArrayList<Double>List<Double>. According to theBased off of your input, the second value is always your double value, but you are trying to parse first value as well which is a date and Double.parseDouble() cannot parse characters that comes in a date such as /, thus you ran into exception. If the double value is what you need then do it simply as :
try { BufferedReader br = new BufferedReader( new FileReader( new File( "SP500-Weekly.txt"" ) ) ); List<Double> list = new ArrayList<Double>(); String line; while ( ( line = br.readLine( ) ) != null ) { String[] r = line.split( "\\s+" ); list.add( Double.parseDouble( r[ 1 ] ) ); } br.close( ); System.out.println( list.size( ) ); } catch ( IOException io ) { e.printStackTrace( ); } You can then play around with list variable as your wish.
Also if you want to be more specific and check if it's actually number/double for second value then I'd do following to add a regex which will make sure that the second value is number (with or without - sign) as below:
while ( ( line = br.readLine( ) ) != null ) { String[] r = line.split( "\\s+" ); for ( String string: r ) { if ( string.matches( "^-?[0-9]?.?[0-9]+" ) ) { list.add( Double.parseDouble( r[ 1 ] ) ); } } }