Solved

text files

Posted on 2001-08-02
4
193 Views
Last Modified: 2012-05-04
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 ?
0
Comment
Question by:dafoki
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 6

Expert Comment

by:graham_k
ID: 6344528
almost right. DOS = CR + LF, Unix = LF only.
0
 
LVL 6

Accepted Solution

by:
graham_k earned 100 total points
ID: 6344548
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
0
 

Author Comment

by:dafoki
ID: 6345121
one more thing:
is CR = \n ?
and NF = \r ?

and in windows does it come \r\n or \n\r ?
0
 
LVL 6

Expert Comment

by:graham_k
ID: 6347474
yes, but you can check it all in the source code whose URL was provided.

Happy coding,

~Graham();
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Google Mini is no longer serving everything 7 164
GUI development for Ubuntu 8 220
Embeded Linux on Router 9 110
Linux : when to add the entries in /etc/hosts file 22 104
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question