Click to See Complete Forum and Search --> : Newline consistency
John E
September 7th, 2008, 05:17 AM
Does anyone know of a handy utility that can open a text file (or list of text files) and convert all the newlines to have a consistent style?
e.g. if the preferred newline character is 0x0A, it would remove 0x0D from all occurrences of 0x0D/0x0A and it would then convert any remaining occurrences of 0x0D to 0x0A.
(hope that makes sense :) )
ovidiucucu
September 7th, 2008, 05:39 PM
AFAIK, the well known Ultraedit does that.
You can also try others from tens of text editors avalable on the net.
And can also make your own "newline converter" with not a ton of sweat... ;)
S_M_A
September 7th, 2008, 06:02 PM
Visual Studio also does that. When loading a file with inconsistent newlines you're asked what type you prefer to convert to (or you can let it be as it is)
John E
September 8th, 2008, 06:20 AM
Thanks. I did try a few editors but none of mine seemed to do it (surprisingly, even 'Save As' didn't change any pre-existing newlines). Anyway, I ended up writing a small utility myself. It only took half an hour. :thumb:
John E
September 8th, 2008, 10:02 AM
Here it is, in case it's of use to anyone else....
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.