Author Topic: Stop Code::Blocks from adding a new line at the end of a .txt file  (Read 5239 times)

Offline Krovlar

  • Single posting newcomer
  • *
  • Posts: 2
I have a program that reads a list of times from a file. Unfortunately Code::Blocks adds an extra line to the bottom of every .txt file. This is causing my program to read it as a 0, which is screwing up the rest of the calculations. Is there a way to stop Code::Blocks from adding that extra line? I have tried deleting it, but as soon as I save it is back.

Thank you.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Stop Code::Blocks from adding a new line at the end of a .txt file
« Reply #1 on: April 28, 2012, 06:44:36 pm »
Settings->Editor...->End-of-line options (box)->End files with blank line
Be warned that this is a global option, so you will need to manually ensure your C/C++ files end in a blank line if you disable it.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Stop Code::Blocks from adding a new line at the end of a .txt file
« Reply #2 on: April 28, 2012, 06:45:02 pm »
Most likely "Settings -> Editor... -> General settings -> Editor settings -> End-of-line options -> End files with blank line" .

Offline Krovlar

  • Single posting newcomer
  • *
  • Posts: 2
Re: Stop Code::Blocks from adding a new line at the end of a .txt file
« Reply #3 on: April 28, 2012, 07:19:43 pm »
Awesome, thank you both. I always make sure my C++ files end in a blank link, I learned c++ using notepad, which was terrible, but it taught me to be careful.

Thanks again,

Billy