removing blank / empty lines from editor ?
-
OK. I asked before so this is a repost... (so sue me...) Is there a plain (text) editor which can remove empty lines ? It would be nice to add as "plug in" into my "development tool"... Thanks
-
OK. I asked before so this is a repost... (so sue me...) Is there a plain (text) editor which can remove empty lines ? It would be nice to add as "plug in" into my "development tool"... Thanks
-
OK. I asked before so this is a repost... (so sue me...) Is there a plain (text) editor which can remove empty lines ? It would be nice to add as "plug in" into my "development tool"... Thanks
For JavaScript and Typescript, use eslint to do that. You should be linting your projects anyway. [no-multiple-empty-lines | ESLint Stylistic](https://eslint.style/rules/js/no-multiple-empty-lines) If you install the eslint plugin for VS Code, it'll do that every time you save a file. But, you don't need VS Code to use it.
Jeremy Falcon
-
OK. I asked before so this is a repost... (so sue me...) Is there a plain (text) editor which can remove empty lines ? It would be nice to add as "plug in" into my "development tool"... Thanks
notepad++
CI/CD = Continuous Impediment/Continuous Despair
-
notepad++
CI/CD = Continuous Impediment/Continuous Despair
Specifically, for most files replace '\r\n' with nothing, and select 'Extended' in the options
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
-
OK. I asked before so this is a repost... (so sue me...) Is there a plain (text) editor which can remove empty lines ? It would be nice to add as "plug in" into my "development tool"... Thanks
-
Specifically, for most files replace '\r\n' with nothing, and select 'Extended' in the options
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
No, that'll collapse everything to a single line! To remove blank lines, in Regular Expression mode replace \r\n(\r\n)+ with \r\n That assumes that the blank lines don't have any whitespace. If they might, then replace \r\n(\s*\r\n)+ with \r\n
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed." - G.K. Chesterton
-
Nice. I copied about 4000 lines of code and copied it back to my .cpp file. I will try to see how my current messy " under construction " file looks now ,,, I would probably do "CodeBeautifier" when my code gets too messy... about hourly... just kidding Thanks
-
Nice. I copied about 4000 lines of code and copied it back to my .cpp file. I will try to see how my current messy " under construction " file looks now ,,, I would probably do "CodeBeautifier" when my code gets too messy... about hourly... just kidding Thanks
If you're looking to reformat your code, you might want to take a look at [ClangFormat — Clang 18.0.0git documentation](https://clang.llvm.org/docs/ClangFormat.html) Depending on which IDE you're using, you may find that others have already created plug-ins for it. A quick google around suggests that Visual Studio and QtCreator both have instructions on how to integerate.
"A little song, a little dance, a little seltzer down your pants" Chuckles the clown
-
No, that'll collapse everything to a single line! To remove blank lines, in Regular Expression mode replace \r\n(\r\n)+ with \r\n That assumes that the blank lines don't have any whitespace. If they might, then replace \r\n(\s*\r\n)+ with \r\n
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed." - G.K. Chesterton
Thanks! I was being brain dead. I have removed blank lines the way you showed before but dyslexia kicked in.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
-
OK. I asked before so this is a repost... (so sue me...) Is there a plain (text) editor which can remove empty lines ? It would be nice to add as "plug in" into my "development tool"... Thanks
VIM or NeoVim can do this. [https://stackoverflow.com/questions/706076/vim-delete-blank-lines#706083\](https://stackoverflow.com/questions/706076/vim-delete-blank-lines#706083) When I first started with VI I hated it. The more I learn though, the better it is. It's my editor of choice now, but I confess I don't use it enough to keep all the goodness in my head, and I often need a few moments to get into the VIM headspace when I start.
-
Specifically, for most files replace '\r\n' with nothing, and select 'Extended' in the options
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
Or 'Edit' -> 'Line Operations' -> 'Remove Empty Lines'
Regards Nelviticus
-
notepad++
CI/CD = Continuous Impediment/Continuous Despair
-
OK. I asked before so this is a repost... (so sue me...) Is there a plain (text) editor which can remove empty lines ? It would be nice to add as "plug in" into my "development tool"... Thanks
^\x0a|^\x0d|^[\s]+.$ seems to work . "Buyer Beware"
-
OK. I asked before so this is a repost... (so sue me...) Is there a plain (text) editor which can remove empty lines ? It would be nice to add as "plug in" into my "development tool"... Thanks
-
No, that'll collapse everything to a single line! To remove blank lines, in Regular Expression mode replace \r\n(\r\n)+ with \r\n That assumes that the blank lines don't have any whitespace. If they might, then replace \r\n(\s*\r\n)+ with \r\n
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed." - G.K. Chesterton
That's what I was thinking; you don't need a separate tool to remove blank lines; a regex search and replace ought to do it. My real question (to the OP) is, does he want the editor to keep the blank lines but just not show them, or really remove them altogether?
-
OK. I asked before so this is a repost... (so sue me...) Is there a plain (text) editor which can remove empty lines ? It would be nice to add as "plug in" into my "development tool"... Thanks
-
OK. I asked before so this is a repost... (so sue me...) Is there a plain (text) editor which can remove empty lines ? It would be nice to add as "plug in" into my "development tool"... Thanks
Don't know (and IDC) about plugin into any development system, but for years, I am using PsPad as my go-to plain text editor on Windows, and it has a function to remove blanks lines (and many other options)...