|
|
|
|
![]() ![]() |
Jul 12 2008, 11:59 AM
Post
#11
|
|
|
Super Member Group: Members Posts: 510 Joined: 29-September 06 Member No.: 16,228 |
|
|
|
|
Jul 31 2008, 12:45 PM
Post
#12
|
|
|
Member [ Level 2 ] Group: [HOSTED] Posts: 60 Joined: 30-July 08 From: New Zealand Member No.: 31,753 |
Putting in my own two cents on a slightly different slant...
If copying, say a plain text document from Linux to Windows, remember that the endline characters are sometimes different. The command line... unix2dos <filename> ...should convert the plain text file into a version that won't have black squares (or variation of) instead of ENTER. |
|
|
|
Jul 31 2008, 01:04 PM
Post
#13
|
|
|
Way Out Of Control - You need a life :) Group: [MODERATOR] Posts: 2,042 Joined: 16-August 05 Member No.: 7,896 |
Putting in my own two cents on a slightly different slant... If copying, say a plain text document from Linux to Windows, remember that the endline characters are sometimes different. The command line... unix2dos <filename> ...should convert the plain text file into a version that won't have black squares (or variation of) instead of ENTER. Nicely seen, Lancer. And, of course, "unix2dos" is not a Windows command, so you should issue while you are on the Linux machine. By the way, personally, I never have these black squares. This is because I have the opposite problem, when being under Unix and reading a pure text coming from a windows/dos machine, I have a lot of "^M" at the end of my text files. Then, the trick is to know some "vi" command-lines. My trick : you open your text file under vi ("vi myfile.txt" for instance), and when you see your file on the screen you type : Esc : % s/Ctrl-VCtrl-M// All people familiar with vi understand the thing immediately, maybe I should comment it for a few ones : Esc stands for the Escape key, you really type the escape key (at the upper-left side of your keyboard), this initializes the command-line sequence. % stands for "In the whole current document" s means "substitute the text between the first two "/" separators, with the text before the last "/" Ctrl-V means that you hold the Ctrl key (bottom right of your keyboard) why you time the v key. Ctrl-V is a command telling vi not to evaluate the sign which follows it. Ctrl-M means means pressing the Ctrl key while pressing M. This Ctrl-VCtrl-M is a nice feature. It asks vi not to evaluate the Ctrl-M, which is Enter, and Enter is also a vi command which means "go to the next line". So, the whole command line is saying vi , for each occurrence of Ctrl-M, to replace it with nothing. This seems rather complicated. However, once you get the trick, it goes fast. And you are not bothered by the Ctrl-M's at the end of each line when you are on Linux editing files coming from a windows or dos system. Of course, if you installed correctly your Linux system and you did not start editing your file yet, you can still type dos2unix myfile.txt This was my own 21 cents to this subject. Yordan |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 12th October 2008 - 11:40 AM |