Solved

text files

Posted on 2001-08-02
4
184 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
  • 3
4 Comments
 
LVL 6

Expert Comment

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

Accepted Solution

by:
graham_k earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
yes, but you can check it all in the source code whose URL was provided.

Happy coding,

~Graham();
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
tallylog file 2 2,576
what is Amazon Linux AMI 6 53
predeployment and postdeployment script in linux rpm 1 25
Shell script for mvn build 2 65
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now