C++ rewrite file : <p>I have a C++ class where many of the assignments involve copying and pasting code from the book. Problem is that the format of the book makes this a very tedious task. When I copy and paste, there are extraneous numbers and spaces on the left of the code, and parts of the code are misaligned.  I'm looking to write a C++ program to read a file (probably a .txt) to reformat the code and delete the numbers on the side.  </p>

<p>However, I've been searching cplusplus.com, and can't figure out what library to import, so that I can open and edit the file.  I'd appreciate a point in the right direction, and any tips for text editing any of you might have.  Thank you.</p>
