OT - DOS vs Linux text files?
Greetings, Highlighting and pasting from what I think is an origionally created in windows text file to a linux file produces successive lines that are indented across the screen. However when I create a file in linux and then highlight and paste into another file it works fine. I think the files that are giving me trouble are windows created because I see: BlessedEquipment.html [dos] 127L, 4640C written when I :w in vim. If the problem is they were created within windows then what is it I need to strip out of the files? Use perl to do it? I'm frustrated with constantly having to highlight and paragraphs of text. Bill
Re: OT - DOS vs Linux text files?
On Fri, Feb 23, 2001 at 12:12:58PM -0600, William Jensen wrote: Greetings, If the problem is they were created within windows then what is it I need to strip out of the files? Use perl to do it? You might look at the dos2unix program and its partner unix2dos. -- Carl Fink [EMAIL PROTECTED]
Re: OT - DOS vs Linux text files?
Highlighting and pasting from what I think is an origionally created in windows text file to a linux file produces successive lines that are indented across the screen. However when I create a file in linux and then highlight and paste into another file it works fine. I think the files that are giving me trouble are windows created because I see: BlessedEquipment.html [dos] 127L, 4640C written when I :w in vim. If the problem is they were created within windows then what is it I need to strip out of the files? Use perl to do it? Bill Hey Bill. Perl is exactly the tool to do this. I admin an environment catering to Macs and this is the same thing. What you want to do is get the hex code for the DOS CR/LF. (I think it's \x0D\x0A) and changed it to \n. The script for this is: $ perl -pi.old -e 's/\x0D\x0A/\n/g;' readme.txt This will substitute newlines for CR/LF in readme.txt and create readme.txt.old as a backup. HTH. Cheers, -- Lance Levsen, Programmer Product Innovation PWGroup - S'toon. 477-3166
Re: OT - DOS vs Linux text files?
On Fri, Feb 23, 2001 at 01:11:53PM -0500, Carl Fink wrote: On Fri, Feb 23, 2001 at 12:12:58PM -0600, William Jensen wrote: Greetings, If the problem is they were created within windows then what is it I need to strip out of the files? Use perl to do it? You might look at the dos2unix program and its partner unix2dos. -- I installed the sysutils and ran it on all the files I had in a particular directory. Opened up a file and copied from one to another and the same thing happens. Could this be a tab issue? Here is an example of what I see on a paste: body h3Equipment: Adventurers Tokens/h3 h3Area: Varies/h3 h3Quest Level: N/A/h3 h3Notes:/h3 Any ideas? Wm Carl Fink [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT - DOS vs Linux text files?
On Fri, Feb 23, 2001 at 12:56:20PM -0600, William Jensen wrote: On Fri, Feb 23, 2001 at 01:11:53PM -0500, Carl Fink wrote: On Fri, Feb 23, 2001 at 12:12:58PM -0600, William Jensen wrote: Greetings, If the problem is they were created within windows then what is it I need to strip out of the files? Use perl to do it? You might look at the dos2unix program and its partner unix2dos. -- I installed the sysutils and ran it on all the files I had in a particular directory. Opened up a file and copied from one to another and the same thing happens. Could this be a tab issue? I meant to say I installed the sysutils pkg which contained dos2unix and that I what I ran against the directory of text files. Here is an example of what I see on a paste: body h3Equipment: Adventurers Tokens/h3 h3Area: Varies/h3 h3Quest Level: N/A/h3 h3Notes:/h3 Any ideas? Wm Carl Fink [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: OT - DOS vs Linux text files?
also sprach William Jensen (on Fri, 23 Feb 2001 01:35:09PM -0600): Although...that doesn't explain why it doesn't happen if I create the file in unix first and then highlight/paste to another file. In that instance it pastes fine. Very strange. But thanks for your knowledge. pasting in unix happens through gpm/X. what vi/vim effectively gets is text input as if you had typed it yourself. vim furthermore comes with a feature to automatically indent source code according to a set of rules. if you set nosmartindent, set nocindent, set noautoindent, the paste should work just fine. set paste does this as well as disabling wrapping and some other funky stuff that could get in the way of X buffer pastes. set nopaste restores that all. martin [greetings from the heart of the sun]# echo [EMAIL PROTECTED]:1:[EMAIL PROTECTED]@@@.net -- when I was a boy I was told that anybody could become president. now i'm beginning to believe it. -- clarence darrow
Re: OT - DOS vs Linux text files?
On Fri, Feb 23, 2001 at 12:12:58PM -0600, William Jensen wrote: Highlighting and pasting from what I think is an origionally created in windows text file to a linux file produces successive lines that are indented across the screen. However when I create a file in linux and then highlight and paste into another file it works fine. I think the files that are giving me trouble are windows created because I see: BlessedEquipment.html [dos] 127L, 4640C written when I :w in vim. If the problem is they were created within windows then what is it I need to strip out of the files? Use perl to do it? I'm frustrated with constantly having to highlight and paragraphs of text. try 'set ff=unix' to save as unix format and 'set ff=dos' to save in dos format. Hilighting is done with 'v' for visual while in command mode. You should really type ':help' one of these days and read a bit up on your editor. ;-) -- Chad Walstrom [EMAIL PROTECTED] | a.k.a. ^chewie http://www.wookimus.net/| s.k.a. gunnarr Key fingerprint = B4AB D627 9CBD 687E 7A31 1950 0CC7 0B18 206C 5AFD pgpY9YNKTHI1G.pgp Description: PGP signature
Re: OT - DOS vs Linux text files?
On Fri, Feb 23, 2001 at 02:12:42PM -0600, Chad C. Walstrom wrote: On Fri, Feb 23, 2001 at 12:12:58PM -0600, William Jensen wrote: Highlighting and pasting from what I think is an origionally created in windows text file to a linux file produces successive lines that are indented across the screen. However when I create a file in linux and then highlight and paste into another file it works fine. I think the files that are giving me trouble are windows created because I see: BlessedEquipment.html [dos] 127L, 4640C written when I :w in vim. If the problem is they were created within windows then what is it I need to strip out of the files? Use perl to do it? I'm frustrated with constantly having to highlight and paragraphs of text. try 'set ff=unix' to save as unix format and 'set ff=dos' to save in dos format. Hilighting is done with 'v' for visual while in command mode. You should really type ':help' one of these days and read a bit up on your editor. ;-) I'm familiar with highlighting/pasting, nudging a paragraph in/out etc in the same file. I was just confused why a paste from a diff text file (using the mouse as the cut/paste tool) was producing crazy indenting. Looks like the culprit was cindent in my case. Thanks for the noai tip. That also fixes the paste. Thanks to all who responded. Bill -- Chad Walstrom [EMAIL PROTECTED] | a.k.a. ^chewie http://www.wookimus.net/| s.k.a. gunnarr Key fingerprint = B4AB D627 9CBD 687E 7A31 1950 0CC7 0B18 206C 5AFD