LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-11-2005, 12:30 PM   #1
joshknape
Member
 
Registered: Jul 2005
Posts: 216

Rep: Reputation: 30
converting Windows text to Linux text


Is there any way to convert a large number of Windows text (Notepad) files at once to the Linux text format? I'm going to move all my text files over, and I'd rather not clean them up one by one.
 
Old 09-11-2005, 12:36 PM   #2
mstep
LQ Newbie
 
Registered: Jun 2005
Posts: 23

Rep: Reputation: 15
I always thought the formats were identical. Have you tried creating a test file in windows notepad and opening it in linux to check?
 
Old 09-11-2005, 12:51 PM   #3
aysiu
Senior Member
 
Registered: May 2005
Distribution: Ubuntu with IceWM
Posts: 1,776

Rep: Reputation: 66
I was under that impression as well, since I often edit in Linux text-only files stored on my Windows FAT32 partition. What happens when you open the "Windows text" in Linux?
 
Old 09-11-2005, 12:52 PM   #4
Snowbat
Member
 
Registered: Jun 2005
Location: q3dm7
Distribution: Mandriva 2010.0 x86_64
Posts: 338

Rep: Reputation: 30
You can do it by directory with the following. Adjust input and output directories as required. I've used a sed method from http://www.student.northpark.edu/pem...d/sed1line.txt instead of dos2unix.

cd /mnt/windows/Windows/; for i in *.txt; do cat $i | sed 's/.$//' > /home/josh/$i; done


mstep: Linux uses (LF) to mark end of lines. DOS/Windows use (CR)(LF), and Macs just to be different use (CR). The usual complaint you hear about this is that in Windows Notepad, Linux text files show all on a single line with squares showing where the lines should end.

Last edited by Snowbat; 09-11-2005 at 12:56 PM.
 
  


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
How change text color using linux in text mode only runlevel 3? Xavius Linux - General 7 05-07-2009 02:19 AM
converting text file from linux to ms dos Berhanie Linux - Newbie 4 12-24-2003 10:54 PM
converting man pages to windows-readable text peok Linux - General 4 10-12-2003 02:52 PM
C, converting hex to text Sm0k3 Programming 2 10-11-2003 04:29 AM
Converting Text To HTML Glock Shooter Programming 6 07-03-2002 06:08 PM


All times are GMT -5. The time now is 03:46 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration