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.
|
I always thought the formats were identical. Have you tried creating a test file in windows notepad and opening it in linux to check?
|
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?
|
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. |
All times are GMT -5. The time now is 04:39 PM. |