Friday, April 11, 2014

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

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 mileage 73737.3 7873 12047 7.0418345939 0.8138691894 26.055025476 8.2428463203 5.5882732348 1.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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: