Questions tagged [dos2unix]

About dos2unix conversion program

unix2dos is a Unix tool to convert an ASCII text file from DOS format (carriage return and line break) to UNIX format (line break).

Also see

90 questions
756
votes
27 answers

Convert DOS line endings to Linux line endings in Vim

If I open files I created in Windows, the lines all end with ^M. How do I delete these characters all at once?
Bert Hekman
  • 8,307
  • 3
  • 19
  • 14
368
votes
11 answers

How can I run dos2unix on an entire directory?

I have to convert an entire directory using dos2unix. I am not able to figure out how to do this.
Vivek Gaur
  • 3,893
  • 3
  • 14
  • 15
66
votes
3 answers

Eclipse Editor: How to change file format from Dos to Unix

I am using eclipse editor to work on my remote files it appears that eclipse editor is set to dos file format, I do not know how to find fileformat set in eclipse editor, but I want it to be set on unix file format. How can I set file format options…
Rachel
  • 91,207
  • 112
  • 255
  • 361
61
votes
1 answer

Convert line endings

I have been using d2u to convert line endings. After installing Puppy Linux I noticed that it does not come with d2u, but dos2unix. Then I noticed that Ubuntu is missing both by default. What is another way to convert line endings?
Steven Penny
  • 82,115
  • 47
  • 308
  • 348
22
votes
10 answers

Anything like dos2unix for Windows?

I have some shell scripts created on windows I want to run dos2unix on them. But as I have read that dos2unix works in Linux environment so, is there a way that I can convert my files to UNIX format while working in Windows? I have already installed…
Elvin
  • 1,831
  • 7
  • 19
  • 24
19
votes
3 answers

Port dos2unix to brainfuck

I got into an argument over on SuperUser.com about useless answers and found myself challenging the other poster to answer the question in brainfuck. He didn't take me up on it, but now I'm curious. All the program needs to do is convert CRLF line…
quack quixote
  • 553
  • 1
  • 4
  • 13
18
votes
4 answers

Git: Removing carriage returns from source-controlled files

I've got a Git repository that has some files with DOS format (\r\n line endings). I would like to just run the files through dos2unix (which would change all files to UNIX format, with \n line endings), but how badly would this affect history, and…
Blixt
  • 47,351
  • 13
  • 105
  • 150
18
votes
2 answers

Convert files to UNIX format using Maven

I have an application that is developed in a Windows environment. The application itself gets deployed to a Linux environment. Each time I deploy this application I have to convert executable files to UNIX format using dos2unix. I originally thought…
Dan Polites
  • 6,500
  • 10
  • 47
  • 54
15
votes
4 answers

dos2unix doesn't convert ^M

I exported results in a text file from a program running on Windows 7, and copied the file on Xubuntu 14.04. In a terminal, I ran dos2unix file.txt, which tells me converting file out_mapqtl.txt to Unix format. However, when I look at the file with…
tflutre
  • 2,934
  • 4
  • 36
  • 52
12
votes
2 answers

unix2dos (or dos2unix) in ant

How do I do unix2dos (or dos2unix) with ant. I.e. I want to change the newlines from linux newlines (if any) to dos newlines
flybywire
  • 232,954
  • 184
  • 384
  • 491
12
votes
3 answers

Why does my tool output overwrite itself and how do I fix it?

The intent of this question is to provide an answer to the daily questions whose answer is "you have DOS line endings" so we can simply close them as duplicates of this one without repeating the same answers ad nauseam. NOTE: This is NOT a duplicate…
Ed Morton
  • 157,421
  • 15
  • 62
  • 152
11
votes
8 answers

How to find a windows end of line (EOL) character

I have several hundred GB of data that I need to paste together using the unix paste utility in Cygwin, but it won't work properly if there are windows EOL characters in the files. The data may or may not have windows EOL characters, and I don't…
Stephen Turner
  • 2,324
  • 7
  • 28
  • 44
11
votes
3 answers

dos2unix: Binary symbol 0x04 found at line 1703

I download a file from the OECD http://stats.oecd.org/Index.aspx?datasetcode=CRS1 ('CRS 2013 data.txt') by selecting Export-> Related files. I want to work with this file in Ubuntu (14.04 LTS). When I run: dos2unix CRS\ 2013\ data.txt I…
dw8547
  • 248
  • 1
  • 2
  • 10
9
votes
5 answers

How to convert files from Dos to Unix

I am having several files which I want to convert from Dos to Unix. Is there any API or method which will help me to do this?
Code Hungry
  • 3,520
  • 20
  • 62
  • 91
8
votes
2 answers

How do I implement a pre-commit hook script in SVN that calls dos2unix to validate checked-in file

I was wondering if anyone here had some experience writing this type of script and if they could give me some pointers. I would like to modify this script to validate that the check-in file does not have a Carriage Return in the EOL formatting. The…
Julien Nephtali
  • 445
  • 1
  • 6
  • 12
1
2 3 4 5 6