Wed Apr 23 21:39:20 2003 From: Navin Hi John Thanks a lot - I really appreciate your help.....It works. You have just saved me hours of work. cheers Navin >>> john 04/23/03 02:02AM >>> On Tue, 22 Apr 2003, Navin wrote: >-->Hi John >--> >-->Have a query about some functions of vi editor-hope you can help. >--> >-->I have 2 files : file1.dat and file2.dat >-->I need to cut portions(very large portions) of text from file1.dat and >-->paste it in file2.dat. >--> >-->Can you please advise as how to do that in the vi editor? Navin, There are several ways of doing this, but let's try the following first. Since we're pasting info from file1.dat into file2.dat we will probably want to open file2.dat and read file1.dat in and remove the parts you don't need while in file2.dat. OR, you could create separate files from file1.dat that you'd read in as you need them... file1, file2, file3, etc. Ok, to read file1.dat into file2.dat do the following: 1) cd (directory where both file1.dat and file2.dat are) 2) type: vi file2.dat 3) MOVE TO FIRST ENTRY POINT: move cursor to point in file where you wish to insert file1.dat (or parts of it) (use f or the "j" key to move down) you may also set the line numbers on the left: set nu then to get to the line number: (line number) you could also SEARCH on a unique word, e.g., unique: /unique 4) once you're at the point in your file, then read in the file: :r file2.dat 5) to delete unwanted parts of file1.dat, simply move your cursor to the beginning of the unwanted block and type: ma THEN move the cursor to the end of the unwanted block and type: d'a ( basically, "mark" a, then "delete" block a ) 6) repeat process until file is merged as desired. hope that helps, john ---- ------------------------------------------------------------------------- ** john-at-wagoneers.com via PINE on Linux ** (plain text please!) ** http://wagoneers.com ** ** http://freegift.net ** Snohomish, Washington USA - where Jeeps don't rust, they mold. ...and remember, leaving life without Jesus just isn't recommended... ------------------------------------------------------------------------- -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. Mailscanner thanks transtec Computers for their support. [ Part 2: "Attached Text" ] BEGIN:VCARD VERSION:2.1 X-GWTYPE:USER FN:Navin Jahajeeah TEL;WORK:012 841 4614 ORG:;M&MTek TEL;PREF;FAX:012 841 3378 EMAIL;WORK;PREF;NGW:NJahajeeah@csir.co.za N:Jahajeeah;Navin END:VCARD