Write to files with Tokenizer

0

I have a file separated by pipes "|" where with tokenizer I am reading the fields, now what you would do is that the parameters are updated automatically, the only thing that would need to be rewrite the data but only that space, The way I read them is as follows:

public class ReadLine(){
  String line;
  BufferedReader brMTOPDev = new BufferedReader(new FileReader(mboppath + 
  "mtop_device"));

        while((line = brMTOPDev.readLine()) != null){
            StringTokenizer sTokenizer = new StringTokenizer(line , "|");
            while(sTokenizer.hasMoreTokens()) {
                String statMTOP = sTokenizer.nextToken().toString();
                String startCap = sTokenizer.nextToken().toString();
                String statCap = sTokenizer.nextToken().toString();

                //System.out.println(line);
            }
}

to write a value in startCap what would be the way to do it? I have read several on how to write but I have not found anything like this

the File values are as follows

0|1|0

and I want to change them to

0|0|0
    
asked by MAEscobar 28.07.2017 в 01:03
source

0 answers