Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

text files

Posted on 2001-08-02
4
Medium Priority
?
204 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 400 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

Setting up LaraDock for Laravel

Learn how to set up LaraDock in a Laravel project - LaraDock gives us an easy way to run a Laravel application using Docker in a single command.

Question has a verified solution.

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

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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

722 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