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

94 questions
0
votes
1 answer

I would like to add ^M at the end of all row in CSV file

I have the CSV file that contains data around 100M rows and I would like to add ^M at the end of each row because if not have a ^M I cannot load the CSV file into the table(It just load only the 1st row and then ignore another row). I tried to add…
user7333846
  • 81
  • 3
  • 10
0
votes
1 answer

Java Parsing Error when running program in Eclipse

I wrote an application in eclipse on Windows and i have moved it over to a Raspberry pi. now when i try to run the application from eclipse i get an error. /opt/jre/jdk1.8.0_101/bin/java: 1: /opt/jre/jdk1.8.0_101/bin/java: Syntax error: end of…
Display Name
  • 405
  • 6
  • 26
0
votes
0 answers

Removing ^M characters from all files inside the jar file

While transferring the project ear file from windows to unix, one of the jar file inside ear is modified, and all the files including files inside sub folders in the jar are added with (^M) characters. Need help in removing ^M characters from all…
0
votes
0 answers

dos2unix stopped working when started from crontab

Have got a shell script which has been running a couple of years without a problem. It's very simple - just runs dos2unix on some files, each time checking the exit code and aborting the script if $? is not 0. Wednesday last week dos2unix started…
0
votes
2 answers

How to add a column in a file whose values are equivalent to epoch conversion of one of the date colmn already in that file using unix commands?

Suppose I have a .txt file in my unix database : events.txt with 3 columns and 4 records as follow: Name DateofBirth City Alex 2016-02-22 15:12:21.244000 London John 2016-02-24 15:12:21.244000 …
0
votes
2 answers

How to delete HDFS folder having windows special characters (^M) in the name

I wrote a shell script to create hdfs folders in windows 7 and ran on Linux server. Now, hdfs folders got created but with special character ^M at the end of the name(probably carriage return). It doesn't show up in Linux but i can see when the 'ls'…
0
votes
1 answer

Convert expect output from DOS to UNIX style in realtime

I write some expect scripts by connecting to a remote host through serial connection. My problem is that the output of the spawned process (enabled with log_user 1) contains DOS-style endings (each line being terminated with ^M when reading logs in…
Eugeniu Rosca
  • 5,177
  • 16
  • 45
0
votes
1 answer

Remove BOM from XML files for the subdirs using dos2unix in Windows

I have some problems with BOM symbols in a large amount of XML files nested in the subdirectories. Some of them have the BOM and I need to remove it. I can do it for the exact directory like this: dos2unix.exe -r d:\path\to\directory But I need…
0
votes
5 answers

for loop / unix2dos to clean a group of files with specific extension

I am trying to use unix2dos on a group of C++ source code files. Basically, unix2dos converts LF to CRLF. I could simply do the following, and it does what I want : #!/bin/sh find . -type f \( -name "*.h" -o -name "*.cpp" \) -exec unix2dos {}\; but…
Michel Hua
  • 1,614
  • 2
  • 23
  • 44
0
votes
1 answer

throwing error executing jar file after executing dos2unix command in linux

I have a jar file which is copied from a windows machine onto unix machine....usually we convert all the files that were copied from windows using dos2unix command.. When I convert the jar file to unix format using dos2unix...I am getting the below…
disizjay
  • 23
  • 2
  • 10
0
votes
4 answers

Code formatting across Windows and Unix

What Visual Studio settings and .emacs macros improve the likelihood that code written on Windows (in visual studio) will still look good in Emacs (and vice versa)? I've recently taken to turning off tabs in emacs (so tabs are rendered via spaces)…
dicroce
  • 45,396
  • 28
  • 101
  • 140
0
votes
1 answer

Error on install of dos2unix via homebrew

Getting an error when I try to install dos2unix via homebrew. brew doctor has no suggestions, and other install work like a charm. No idea where to start tracing it. $ brew install dos2unix ==> Downloading…
Dustin
  • 127
  • 1
  • 2
  • 9
-1
votes
1 answer

How to replace proxy list from \n to \r\n

I want to replace proxy list on linux from \n to \r\n. I got line breaks pasted with just \n. So I need to replace \n line breaks to \r\n. How can I be make this change?
Albert
  • 1
-1
votes
1 answer

Hidden characters added while converting from dos2unix

Input file in comma separated .csv format: 25 Mbps^M 25 Mbps^M 25 Mbps^M 0 Mbps ^M 0 Mbps ^M 0 Mbps ^M 0 Mbps ^M ash Back  ^M ash Back  ^M ash Back  ^M while converting from dos2unix, the spaces before ^M is getting converted to hidden…
-1
votes
1 answer

File name with versions comparison in shell script

Suppose I have file names like abc-1.0.sh,xyz-1.0.sh,pqr-1.0.sh,abc-2.0.sh, abc-3.0.sh. I am trying with array concept, but not able to do it. I want file names as abc-3.0.sh,xyz-1.0.sh,pqr-1.0.sh only. How should I do it in .sh file?
Prasad
  • 3
  • 1
  • 3