Re: Select entire line based on tag, then export only those lines of text

2014-04-11 Thread Mart Lubbers
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

:g/pattern/d to delete lines matching pattern
:g!/pattern/d to delete lines not matching pattern so just do
:g!/\cambulance/d and then :w newfile to save the lines containing ambulance to 
newfile. The \c is for matching case insensitive.


Mart


On April 11, 2014 4:37:02 PM CEST, Greg Nevius gnev...@gmail.com wrote:
Hello everyone! First off, let me say that I am a designer, and don't
have the higher level of thinking required to do what I would like to
accomplish. That being said, if anyone could help me, I would be so, so
grateful and appreciative!

Here's what I've got - a tab delimited text file  ~1.6GB. It's a huge
file.

Step 1:
What I need to do is search out anything that has the word ambulance
and copy the entire line in VIM. Here's a example of l entry:

1003006180 MEDICWEST AMBULANCE, INC.   
O   9 W DELHI AVE   NORTH LAS
VEGAS  890327836   NV  US  Ambulance Service Supplier  Y   
F   A0425   Ground
mileage73737.3 787312047   7.04183459390.8138691894
26.0550254768.24284632035.58827323481.3276220145

There are thousands of entries in the text file, so to manually search
through is impossible.

Step 2:
I then need to extract these entries that contain ambulance (the
entire line)and save all of them to another text file. From there, I
can import into Excel.

I had considered going the MySQL route, but that's shaky for me, being
a pixel pusher :)

Is this something that I can easily do in VIM? It seems like it's built
for that.

Once again, thank you very much for any time or assistance you may be
able to provide!

Cheers, G

--
--
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

- --
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-BEGIN PGP SIGNATURE-
Version: APG v1.1.1

iQFBBAEBCgArBQJTSD3WJBxNYXJ0IEx1YmJlcnMgPG1hcnRAbWFydGx1YmJlcnMu
bmV0PgAKCRCpN7ehrT/r5zUSCACyO5CX/lOzA5sU4saC6/CRuj7tCQUy/azt8kgf
/KgLkUYvAg/3DBieOQ1P58p5XmUqFzf/kv5FiiOhFx/JLYoDPXRAIz3EGgHPZH+I
KDTCF5wfiaoaCWxPHgB4L4QPnf7zjkqLS8djOvk2v4iaHoJoZPB0RDBlt1JsVEHf
Nl+M7dB8mfftPR6DQO6JreIsLMGGCr5TP0JWPMLSje0T1v4CYJUMctH8T32sz976
HllFgSdcEDxPjmGWEoZNXxZzD6FQ20tb9qXtgX5lfZRyB3/Kk1Woij80h0MWI2JW
0mss//85Ms5rI2S38BVUHMcT0SH8mjvlkq8NvCOEzvYDKxKy
=EF5T
-END PGP SIGNATURE-

-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


vimrc skeleton

2014-02-05 Thread Mart Lubbers
Hi,
I'm fairly new to writing small vimscripts however I'm well known with
the linux terminal and bash etc.
I've read that to let vim create a skeleton file one can add this to the
vimrc:

au BufNewFile *.tex 0r ~/.vim/tex.skel

However if I want multiple skeletons I have to repeat the line for every
skeleton. I was wondering if it was possible to somehow loop through all
the files in ~/.vim that match *.skel and apply the BufNewFile on that
files.

Mart

-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: vimrc skeleton

2014-02-05 Thread Mart Lubbers
On Wed, Feb 05, 2014 at 10:49:55PM +0100, Marc Weber wrote:
 You can use snippet like solutions, too
 http://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html
 
 for x in ['tex','bar']
  exec 'au BufNewFile
  for x in ['tex','bar']
 exec 'au BufNewFile *.'.x.'  do ...'
  endfor
 endfor
 
 Marc Weber
 
 -- 
 -- 
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.

Hmm, this is still not the way I imagined it. Right now I have a working
thing but it's not really error prone.
For example when you have combined extensions like foo.tar.gz or
something.

for i in split(globpath('~/.vim', '*.skel'), '\n')
let extension = split(split(i, /)[-1], \\V.)[0]
execute join([au BufNewFile *., extension,  0r ~/.vim/, extension, 
.skel], )
endfor

-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.