title: How to remove commas from a text file?
body: <p>I got this far, but it seems that buffer won't take arrays, because first I had it this way</p>
  
  <pre><code>while ((strLine = br.readLine()) != null)   
  {
    // Print the content on the console
   // System.out.println (strLine);
     String Record = strLine;
    String delims = "[,]";
    String[] LineItem = Record.split(delims);
  
    //for (int i = 0; i &lt; LineItem.length; i++)
        for (int i = 0; i == 7; i++)
    {
      System.out.print(LineItem[i]);
    }
  </code></pre>
  
  <p>now I leave at this, because it's reading but not taking out commas.</p>
  
  <pre><code>import java.io.BufferedReader;
  import java.io.File;
  import java.io.FileReader;
  import java.io.FileNotFoundException;
  import java.io.IOException;
  
  public class mainPro1test {
      public static void main(String[] args) {
          File file = new File("test.txt");
          StringBuffer contents = new StringBuffer();
          BufferedReader reader = null;
  
          try {
              reader = new BufferedReader(new FileReader("C:\\2010_Transactions.txt"));
              String text = null;
  
              // repeat until all lines is read
              while ((text = reader.readLine()) != null) {
  
                  String Record = text;
                  String delims = "[,]";
                  String[] LineItem = Record.split(delims);
  
                  contents.append(text)
                      .append(System.getProperty(
                          "line.separator"));
  
  
              }
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          } finally {
              try {
                  if (reader != null) {
                      reader.close();
                  }
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
  
          // show file contents here       
          System.out.println(contents.toString());
      }
  }
  </code></pre>
  
  <p>of how it should look like</p>
  
  <p>input</p>
  
  <pre><code>Sell,400,IWM   ,7/6/2010,62.481125,24988.02,4.43
  Sell,400,IWM   ,7/6/2010,62.51,24999.57,4.43
  </code></pre>
  
  <p>output</p>
  
  <pre><code>Sell    400    IWM    7/6/2010    62.481125    24988.02    4.43
  Sell    400    IWM    7/6/2010    62.51        24999.57    4.43
  </code></pre>