Acerbic Resonance

There’s no substitute for a good subtitle.

Recursively Change Line Endings

So, very rarely I need to change the line endings for a large set of files scattered across a bunch of directories.  Sometimes there are few enough files that I just do it manually, but today I really wanted to do a large batch of them recursively.  I wound up using this in a terminal:

cd /path/to/change/line/endings
find . -type f -exec perl -pi -e 's/\r\n?/\n/g' {} \;

Worked like a charm.  Found this here.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.