LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-24-2003, 12:51 PM   #1
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
converting text file from linux to ms dos


I was trying to create a text file on my floppy which would
be readable (i.e. have the appropriate line breaks) by Windows
Notepad.

I mounted my floppy as vfat and created a small text file
with vi, which I saved back onto the floppy. Then, when I
examined the file with cat -A I saw that each line was still
being terminated with a '\n' instead of the hoped-for '\r\n'
sequence.

I know there are tools for making such conversions, but I
was under the impression that if something was mounted
as vfat, the conversion would take place automatically.

Was I under the wrong impression, or is there something
wrong here?

Thank you.
 
Old 12-24-2003, 01:17 PM   #2
ts_sudarshan
LQ Newbie
 
Registered: Oct 2003
Location: Bangalore
Distribution: Arch, SUSE OSS
Posts: 23

Rep: Reputation: 15
nothing is wrong there except that you were in the wrong impression that by mounting as vfat t will create the file in dos style. there are tools like unix2dos and dos2unix that convert the file format from one to other and vice versa. see if they are there in your distro. if not download it from the net. ATB.
 
Old 12-24-2003, 01:21 PM   #3
vinay_s_s
Member
 
Registered: Jul 2003
Posts: 658

Rep: Reputation: 30
Text files are text files. May it be Linux or window$.

My C program files work as the same on both linux and window$.
 
Old 12-24-2003, 02:16 PM   #4
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
text files are text files, but you can run into problems at the line break. DOS, Mac, and Nix all use a different carriage-return character.
 
Old 12-24-2003, 11:54 PM   #5
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Original Poster
Rep: Reputation: 165Reputation: 165
Thank you for the info.
I thought I read somewhere that the conversion would be automatic.
That's why I was surprised to see that it wasn't.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SED - Converting UNIX to DOS file aurelio26 Linux - Newbie 7 04-09-2008 01:15 AM
converting Windows text to Linux text joshknape Linux - Software 3 09-11-2005 01:52 PM
renaming or converting a text file to a dat file... tangaz Linux - Software 1 10-24-2003 07:57 AM
converting MS-DOS files to Linux dalraidia Linux - Newbie 10 12-25-2002 08:49 PM
Like MS-DOS batch file but for Linux? rverlander Programming 2 06-23-2002 03:51 PM


All times are GMT -5. The time now is 08:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration