public static void writeText ( String featuresFileName , double [ ] [ ] features ) throws Exception { BufferedWriter out = new BufferedWriter ( new FileWriter ( featuresFileName ) ) ; for ( double [ ] feature : features ) { for ( int j = 0 ; j < feature . length - 1 ; j ++ ) { out . write ( feature [ j ] + "," ) ; } out . write ( feature [ feature . length - 1 ] + "\n" ) ; } out . close ( ) ; }
Takes a two - dimensional double array with features and writes them in a comma separated text file .