Code::Blocks Forums

User forums => Help => Topic started by: Krovlar on April 28, 2012, 06:24:33 pm

Title: Stop Code::Blocks from adding a new line at the end of a .txt file
Post by: Krovlar on April 28, 2012, 06:24:33 pm
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.
Title: Re: Stop Code::Blocks from adding a new line at the end of a .txt file
Post by: Alpha 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.
Title: Re: Stop Code::Blocks from adding a new line at the end of a .txt file
Post by: Jenna 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" .
Title: Re: Stop Code::Blocks from adding a new line at the end of a .txt file
Post by: Krovlar 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