Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Is there a unix equivalent dos2unix utility in linux?

Status
Not open for further replies.

shemo

Advanced Member level 4
Joined
Apr 26, 2002
Messages
105
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
709
dos2unix sed

I couldn't find it. pls advise.
thanks
 

cdic

Advanced Member level 4
Joined
Jun 28, 2001
Messages
103
Helped
5
Reputation
10
Reaction score
3
Trophy points
1,298
Location
silly valley
Activity points
882
vi dos2unix

just remove all "^M" from your files using vi or sed or other editors. no need using dos2unix, you can write a simple script to implement this. and name dos2linux. :)
 

jimjim2k

Advanced Member level 3
Joined
May 17, 2001
Messages
996
Helped
23
Reputation
46
Reaction score
13
Trophy points
1,298
Activity points
7,270
dos2unix linux

Hi

Try this perl script

#!/usr/bin/perl
# convert a dos \r\n format to unix \bn
open (FILE, $ARGV[0]);
while (<FILE>) {
# remove the stupid \r, replace with \n
# some broken editors just put \r
s/\r/\n/g;
# Remove the duplicate \n
s/\n\n/\n/g;
print;
}



tnx
 

jimjim2k

Advanced Member level 3
Joined
May 17, 2001
Messages
996
Helped
23
Reputation
46
Reaction score
13
Trophy points
1,298
Activity points
7,270
linux dos2unix

Hi

BTW:

Look at the following perl link for additional free perl scripts.
It is searchable too.


1. h**p://www.perlmonks.org


* -> t

tnx
 

tdo48

Junior Member level 2
Joined
Jan 13, 2002
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
185
dos2unix on linux

Or you meant the reverse operation: unix2dos.....
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top