Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/06/2015, 15:28
poeta3d
 
Fecha de Ingreso: diciembre-2010
Mensajes: 162
Antigüedad: 13 años, 5 meses
Puntos: 1
Exclamación colocar en variable

aqui esta mi codigo, lo que quiero es que cada numero me quede en una variable

Código:
public static void leer_archivo() throws IOException
    {
        String nombre_fichero="AUTO.obj";
        BufferedReader br=null;
        try{
            br=new BufferedReader(new FileReader(nombre_fichero));
            String texto = null;
            
            
            
            
                while((texto = br.readLine())!=null){
                    if(texto.startsWith("#")){
                        continue;
                        
                    }
                    if(texto.startsWith("m")){
                        continue;
                    }
                    if(texto.startsWith("v")){
                        
                        String numeros[];
                        numeros = texto.split(" ");
                        
                        System.out.println(Arrays.toString(numeros));
                        
                    }
                    
                    
                    
                    
                }
            }
        catch(FileNotFoundException e){
               System.out.print(e.getMessage());
            }    
        
    }

    /**
     *
     * @param args
     */
    public static void main(String[] args){
        try {
            leer_archivo();
        } catch (IOException ex) {
            Logger.getLogger(Leer.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
el resultado es este

[v, , 3.2810, -5.6424, 9.2452]
[v, , -0.0000, -5.6424, 9.2452]
[v, , 0.0000, -5.6424, 6.9339]
[v, , 3.2810, -5.6424, 6.9339] etc

quiero tomar cada numero que me lo muestra separado con coma y ponerlo en una variable