Thursday, February 28, 2013

Re: vim edit help

actuall i have to 11 such variables can you please help

var flightDelay = new Array("tvlPlyCp","tvlPlcyCertID","tvlShdIt","tvlConfArlSupId","tvlConfArlcompaid","tvlRepeei","tvlPolRep");
var baggageDelay = new Array("tvlPlyCp","tvlPlcyCertID","tvlShdIt","tvlProIr","tvlConfArlcompaid","tvlRepeei","tvlPolRep");
var baggageLoss = new Array("tvlPlyCp","tvlPlcyCertID","tvlShdIt","tvlProIr","tvlListLost","tvlPolRep");
var tripCacel = new Array("tvlPlyCp","tvlPlcyCertID","tvlShdIt","tvlConfArlcompaid","tvlRrepdsc","tvlPolRep");
var repariation = new Array("tvlPlyCp","tvlPlcyCertID","tvlShdIt","tvlMdRp","tvlRee","tvldc","tvlPolRep","tvladrdc");
var accidentalDisablement = new Array("tvlPlyCp","tvlPlcyCertID","tvlShdIt","tvlMdRp","tvlPolRep","tvladrdc");
var lossOfTravel = new Array("tvlPlyCp","tvlPlcyCertID","tvlShdIt","tvlMhdr","tvlPolRep","tvladrdc");
var secureWallet= new Array("tvlPlyCp","tvlPlcyCertID","tvlShdIt","tvlMhdr","tvlPolRep","tvladrdc");
var others= new Array("tvlPlyCp","tvlPlcyCertID","tvlShdIt","tvlRrepdsc","tvlPolRep","tvladrdc");



On Fri, Mar 1, 2013 at 12:25 AM, vicky b <vickyb2084@gmail.com> wrote:
Can you  please explain more on this section

/Array<CR>
ciwdojox.collections.ArrayList<Esc>


On Fri, Mar 1, 2013 at 12:17 AM, Ben Fritz <fritzophrenic@gmail.com> wrote:
On Thursday, February 28, 2013 12:33:23 PM UTC-6, vicky b wrote:
> HI All,
>
>
>  I have text in below format 
> var illness = new Array("tvlPlyCp","tvlPlcyCertID","tvlShdIt","tvlRepMedEi","tvlMdRp","tvlRrepdsc","tvlPolRep")
>
>
>
>
> i need to convert it 
>
>
>
> var illness = new dojox.collections.ArrayList();
> illness.add("tvlPlyCp");
> illness.add("tvlPlcyCertID")
>
> illness.add("tvlShdIt")
>
>
> illness.add("tvlRepMedEi")
> illness.add("tvlMdRp");
> illness.add("tvlRrepdsc");
> illness.add("tvlPolRep");
>
>
>
> Can anybody help me on this--
> Thanks & Regards
>  Vickyb

Here regular expressions are your friend.

I'd start by changing the "new" line to be correct:
/Array<CR>
ciwdojox.collections.ArrayList<Esc>
f(
dib

Now paste the deleted list of initializers on a new line and put it in the right format:
o<Esc>
p
:s#"[^"]\+",\?\s*#illness.add(\0);\r#g

Done!

All this is untested but it's pretty straightforward so you should be able to fix it.

Help topics so you know what you're doing:
:help text-objects
:help :s
:help /\0
:help /[
:help /\+
:help /\?
:help /\s

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
Thanks & Regards
 Vickyb





--
Thanks & Regards
 Vickyb


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
 
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: