On Mon, Sep 01, 2003 at 11:31:34AM -0400, Subba Rao wrote:
> 
> Hello,
> 
> I have a large text file where 2 lines (fields) form a record.  Now I want 
> to merge the 2 lines into one line seperated by a comma.
> 
> Line1
> Line2
> 
> The fields should be seperated by a comma.
> 
> Line1,Line2

s/\n/,/

> 
> How can I define a keystroke that will,
>       add a comma at the end of Line1
>       perform a JOIN of Line1 and Line2
>       move the cursor to the next record?

First answer:

:map <F3> :s/\n/,/


Second answer:

  :s/\n/,/

And it will be mapped to . (dot) , as it is the last operation

-- 
Tzafrir Cohen                       +---------------------------+
http://www.technion.ac.il/~tzafrir/ |vim is a mutt's best friend|
mailto:[EMAIL PROTECTED]       +---------------------------+

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to