text files

i'm working on a text file convertor, converting unix text files to windows text files and vice versa.

i know that the windows use carriage return (CR) and a line feed (LF) - to mark the end of the line

and unix uses only CR

first of all, am i wrong?
is CR - \n ?
and LF - \r ?
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

graham_kConnect With a Mentor Commented:
you will find source for a progarm which doe sit at ftp://garbo.uwasa.fi/pc/unix/doscvt27.zip

There are any number of freeware programs to do this, so unless you really want to program it, I woul;dn't reinvernt the wheel.

See also    man dos2unix
almost right. DOS = CR + LF, Unix = LF only.
dafokiAuthor Commented:
one more thing:
is CR = \n ?
and NF = \r ?

and in windows does it come \r\n or \n\r ?
yes, but you can check it all in the source code whose URL was provided.

Happy coding,

All Courses

From novice to tech pro — start learning today.