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
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?
Any help appreciated.
Thank you in advance.
hi, How do you diff the records in two lines
how does your text file look like
- this -
Record 1 Line1 Record 1 Line2
Record 2 Line1 Record 2 Line2
Record 3 Line1 Record 3 Line2
- or -
Record 1 Line1 Record 1 Line2 Record 2 Line1 Record 2 Line2 Record 3 Line1 Record 3 Line2
- ** -
ripunjay
-----Original Message----- From: linuxers-bounces@mm.ilug-bom.org.in [mailto:linuxers-bounces@mm.ilug-bom.org.in]On Behalf Of Subba Rao Sent: Monday, September 01, 2003 21:00 To: Mumbai Linux Users Subject: [ILUG-BOM] VI(M) - Changing & Merging 2 lines?
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
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?
Any help appreciated.
Thank you in advance.
-- Subba Rao subba9@cablespeed.com
Old American Wild West saying: God created men but Colt made them equal. Today: Linus created Linux and Linux made IT companies equal.
On 01/09/03 11:29 -0400, Subba Rao wrote: <snip>
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?
Do you need interactivity for this? Or can this be scripted? Easy to script with Perl.
Devdas Bhagat
On Mon, Sep 01, 2003 at 11:29:49AM -0400, Subba Rao wrote:
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
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?
the following colon command would map the <F3> function key to do this.
:map <F3> A,<ESC>Jj
Goto any line and press F3.
It would insert a comma at the end of the line, join this line with the next one, and move to the next line (this would be the same as moving to the next record, then).
Hope this helps.
Regards, - JJH