January 20, 2017

Change EOL (End Of Line) Character from Windows to Unix/Linux for all the files in current working directory

Hi all,

For a single file, you can do the change of EOL using notepad++.
Reference: http://psrdotcom.blogspot.in/2017/01/change-eol-end-of-line-character-from.html

But it would be difficult, if you want to do for multiple files in one go.

I have found a solution to update EOL for all files in the current directory.

Pre-requisite

Make sure that, working directory contains only the files which you want to change EOL.

Note: If not, copy the files to a new directory and change the EOL for all the files in that directory.

Procedure

  1. Download dos2unix utility from sourceforge https://sourceforge.net/projects/dos2unix/
  2. Extract the zip file
  3. Tip: Make sure that the extracted path doesn't contain spaces.
  4. Keep the bin directory available in your PATH environment variables
  5. Download the customized batch file from GIST https://gist.github.com/psrdotcom/d73ff9590c3010253b5b2a886704b26b
  6. Extract if needed, and place the "dos2unixfolder.bat" in the same directory where the "dos2unix" is placed.
  7. Tip: If you place the batch file in the same folder of dos2unix.exe. You no need to add again the patch of batch file in environment PATH.
  8. Navigate to your folder, where you want all the files EOL to be changed
  9. Press "Right Click on Mouse" in empty area
  10. Select "Open Command Prompt Here"
  11. Type the batch file name "dos2unixfolder.bat"
  12. You will able to see the conversion process
  13. Once the conversion is completed, you can check the EOL coversion in notepad++.
  14. If you need to help in checking, refer to http://psrdotcom.blogspot.in/2017/01/change-eol-end-of-line-character-from.html


Please send your comments and feedback to psrdotcom@gmail.com

No comments:

Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com