Projects / hd2u

hd2u

hd2u is Hany's Dos2Unix convertor, a filter used to convert plain text from the DOS format (CR/LF) to the UNIX format (LF) and vice versa. It can also handle files in the Macintosh format (CR) and convert them into other formats.

Tags
Licenses
Operating Systems
Implementation

RSS Recent releases

  •  10 Sep 2008 23:26

Release Notes: If the file type is undetermined (file without line endings or an empty file), this is printed in verbose mode, and no attempt is made to convert the file, thus avoiding truncation of it. There is also a verbose message and Makefile tweaks.

  •  28 Aug 2007 11:16

Release Notes: 'b' has been added to 'fopen()' calls so that conversion is not confused on platforms like Cygwin.

Release Notes: Build enhancements: a 'test' target, a 'dos2unix-optimized' target for compilation of optimized binaries, and the ability to build under MinGW/MSYS.

Release Notes: The most notable changes since the last stable release are support for the Macintosh text format, a new --version (-V) option, and documentation enhancements and fixes.

  •  09 Nov 2004 07:50

Release Notes: Issues with some binary files being recognized as text files in Macintosh format should be resolved. The documentation has been enhanced and some typos in it were fixed.

RSS Recent comments

18 May 2001 02:47 teambob

Re: For example
I think this programme is a good idea for a couple of reasons:

1. If you want to do text stripping on a web site a .c programme will be more secure than a shell script using tr

2. This programme skips binary files.

3. You don't need to screw around with temporary files.

4. You can issue a command to do many files. e.g. dos2unix `find /usr/src/somedosstuff` I made a script to do this a few days ago and it *is* very useful.

5. It is reversible.

6. It's here and it's free. :)

>
> % perl -pi -e's/\r$//;' *.txt
> %
> % This will do the RIGHT thing
>
>
> Same thing can be done with a sed
> script. In the age-old USL-descendent
> Unixes, UnixWare has "dtox" to do the
> same thing with a binary stream (xtod is
> the reverse of dtox on UW).
>
> Allan "SCO" Clark

12 Feb 2001 14:47 loopus

Re: For example

> perl -pi -e's/\r$//;' *.txt
>
> This will do the RIGHT thing

Same thing can be done with a sed script. In the age-old USL-descendent Unixes, UnixWare has "dtox" to do the same thing with a binary stream (xtod is the reverse of dtox on UW).

Allan "SCO" Clark

12 Feb 2001 14:30 gaudior

For example
perl -pi -e's/\r$//;' *.txt

This will do the RIGHT thing

11 Feb 2001 09:29 hany

Re: Why?

> Yes, tell me why I should use this
> software when there already is a usable
> command for this called 'tr'.

If you want to do something like
'dos2unix *.txt *.c' quite often,
if you know how to combine 'tr' and
some shell commands to handle those '*' and if you
do not care about little more efficiency then you
should not use this utility.

> Not only
> can I produce the same effects with 'tr'
> but I also get alot more functionality
> for "free".

Yes, with 'tr' you can do same and
you can do even
more. But I do not understand what does that
"free" mean?

22 Jan 2001 05:00 creel

Why?
Yes, tell me why I should use this software when there already is a usable command for this called 'tr'. Not only can I produce the same effects with 'tr' but I also get alot more functionality for "free".

Screenshot

Project Spotlight

XML Configuration File Editor

A Web service to edit an XML configuration file.

Screenshot

Project Spotlight

ABC Path Solver

An automated solver for the puzzle game ABC Path.