Last active
January 27, 2017 23:49
-
-
Save drhuffman12/1428a9ce6a8ec729287d7d8daa6db59c to your computer and use it in GitHub Desktop.
Replace all "\r\n" occurances with "\n" for all files in a folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@folder_path = 'path/to/your/folder' | |
Dir.glob(File.join(@folder_path,'*')).each {|f| File.open(f, 'w', crlf_newline: false) {|f| f.write(File.read(f).gsub("\r\n","\n") } };nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment