Solved

text files

Posted on 2001-08-02
4
190 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
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
please append a correct root= boot option HELP! cant boot up linux server! 22 686
shell script help 1 145
making an rpm that just copies the entire project 2 51
Problem to telnet 23 165
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

776 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