title: Deleting a certain character from a text file in java
body: <p>So I've recently received a large text file that I need to read unfortunately its formatted terribly as there are next line characters everywhere making it extremely difficult to read. So I've been trying to think of a way to sort through the file and delete each <code>nextLine</code> using a java program.</p>
  
  <p>For example if we had this text:</p>
  
  <pre><code>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse rhoncus interdum      condimentum. Proin viverra   
  justo vel imperdiet sagittis, purus sapien sagittis mi, et blandit purus ante non libero. Nulla ac   
  augue ut odio eleifend interdum  
   ac id justo. Quisque rutrum euismod sem, vel euismod nunc convallis eu. Praesent odio velit,
   condimentum id scelerisque  
   iaculis, vulputate vitae lacus. Fusce adipiscing blandit libero eu venenatis.
   Vestibulum nec urna   
  pulvinar arcu pretium   
  pretium. Duis vitae augue dolor. Etiam consectetur feugiat
   diam sit amet gravida. 
  </code></pre>
  
  <p>we would like it to turn out like this :</p>
  
  <pre><code>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse rhoncus interdum
  condimentum. Proin viverra, justo vel imperdiet sagittis, purus sapien sagittis mi,       
  blandit purus ante non libero. Nulla ac augue ut odio eleifend interdum ac id justo.
  Quisque rutrum euismod sem, vel euismod nunc convallis eu. Praesent odio velit,
  condimentum id scelerisque iaculis, vulputate vitae lacus. Fusce adipiscing blandit
  libero eu venenatis. Vestibulum nec urna pulvinar arcu pretium pretium. Duis vitae
  augue dolor 
  </code></pre>
  
  <p>I'm not very experienced with reading/writing text file using Java. My current idea is reading in each char value checking if it is equal to the value of next line and proceeding to write that char to a separate text file if it is not. But i'm not really sure on how to implement this. I'm not sure how to check if a the next character is a next line.</p>
  
  <p>Any help would be great.</p>