RegEx help

2010-09-01 Thread Kunal Bajpai
The string is (including double quotes) - John Travolta Samuel Jackson I want RegEx that searches the above string and treats John Travolta (between quotes) as one string and Samuel Jackson as the other 2 string. Thus, String 1 = John Travolta String 2 = Samuel String 3 = Jackson Actually, I

Re: RegEx help

2010-09-01 Thread Adam
This should do it. Obviously I'm just doing a basic substitution so you can alter as you need to. s/\(John\s\+Travolta\)\s\+\(samuel\)\s\+\(jackson\)/\1\r\2\r\3/i ~Adam~ On Wed, Sep 1, 2010 at 12:00, Kunal Bajpai kunal.baj...@gmail.com wrote: The string is (including double quotes) - John

Re: Regex help

2009-08-27 Thread Tomas Kramar
2009/8/25 Marcelo Sabino marcelo.sab...@gmail.com: I'm having troubles with ER on vi. Let me explain. I have this data 03;14;Production;trombetas;Xeon;RHEL;-;PPE;-;F1-A0.3;| and I want to copy the data of third field to the last field, like this

Re: Regex help

2009-08-27 Thread Bastiaan Wakkie
Hmm I guess a macro is indeed much better but anyway I worked out a regex for it too: The line: ^(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);\|.?$ the replacement: \1;\2;\3;\5;\6;\7;\8;\9;\10;|\4 If you need to shuffle more I guess the regex comes in handy... ...but somehow I could not

Re: Regex help - \v +

2009-08-27 Thread Sven Guckes
* Marcelo Sabino marcelo.sab...@gmail.com [2009/8/25]: I'm having troubles with ER on vi. Let me explain. I have this data 03;14;Production;trombetas;Xeon;RHEL;-;PPE;-;F1-A0.3;| and I want to copy the data of third field to the last field, like this

Regex help

2009-08-25 Thread Marcelo Sabino
Hi all, I'm having troubles with ER on vi. Let me explain. I have this data 03;14;Production;trombetas;Xeon;RHEL;-;PPE;-;F1-A0.3;| and I want to copy the data of third field to the last field, like this 03;14;Production;trombetas;Xeon;RHEL;-;PPE;-;F1-A0.3;|trombetas How can I do this magic?

RE: Regex help

2009-08-25 Thread Gene Kwiecinski
and I want to copy the data of third field to the last field, like this 03;14;Production;trombetas;Xeon;RHEL;-;PPE;-;F1-A0.3;|trombetas Use fields denoted by a \( and \) to copy/move what you want, eg, :g/\([^;]*;[^;]*;\)\([^;]*\)\(;.*\)/s//\1\2\3\2/ to break it up to

Re: Regex help

2009-08-25 Thread Rik
On Aug 25, 12:26 pm, Marcelo Sabino marcelo.sab...@gmail.com wrote: Hi all, I'm having troubles with ER on vi. Let me explain. I have this data 03;14;Production;trombetas;Xeon;RHEL;-;PPE;-;F1-A0.3;| and I want to copy the data of third field to the last field, like this

Re: Regex help

2009-08-25 Thread Marcelo Sabino
On Tue, Aug 25, 2009 at 3:11 PM, Rik amphib...@gmail.com wrote: On Aug 25, 12:26 pm, Marcelo Sabino marcelo.sab...@gmail.com wrote: Hi all, I'm having troubles with ER on vi. Let me explain. I have this data 03;14;Production;trombetas;Xeon;RHEL;-;PPE;-;F1-A0.3;| and I want to copy

Regex Help: Printable character excluding white space

2009-08-15 Thread Edward Beach
Hi All, I'm trying to get a matchstr function to return me the string of printable character, excluding the white space. So for example, :echo matchstr(:foo^[bar, ':\p*') return foo since ^[ is the esc character. And :echo matchstr(:foo bar, ':\S*') returns foo as well. I'm

Re: Regex Help: Printable character excluding white space

2009-08-15 Thread Tim Chase
I'm trying to get a matchstr function to return me the string of printable character, excluding the white space. So for example, :echo matchstr(:foo^[bar, ':\p*') return foo since ^[ is the esc character. And :echo matchstr(:foo bar, ':\S*') returns foo as well. I'm

Re: Regex help for huge csv file

2009-07-17 Thread bsisco
--keyserver subkeys.pgp.net --recv-keys 4434BAB3 just so everyone knows this has been solved (see below)...but for some reason when i marked it as solved it got posted as a new topic (Re: Regex help for huge csv file[SOLVED]). Not sure why that is but below is the solution i wound up using. Well

Re: Regex help for huge csv file[SOLVED]

2009-07-16 Thread Blake M. Sisco
Well, if they all start with an asterisk in the first column, you may be able to use my first one to get rid of the unwanted data, and then take a second pass to recolumnize the remaining ones: I wound up doing just that. I went through and added an asterisk to the ones that needed to keep,

Re: Regex help for huge csv file

2009-07-16 Thread Richard.Williams.20
You may want to consider using a script using biterscripting ( http://www.biterscripting.com ) . One of the things its editor commands can do is to match regular expressions across lines, words, characters, strings. Make sure you start with the clearest of requirements - that way you can

Re: Regex help for huge csv file

2009-07-16 Thread bill lam
On Tue, 14 Jul 2009, Blake M. Sisco wrote: John, Sorry about that. Here's a set of examples Before: *,WIRE HARNESS, ,20403,16 ,FIBERGLASS, ,100 FOOT, ,20400,7 ,FIBERGLASS, ,250 FOOT SPOOL, ,WX12-0,35 ,WX14-1BR/YLW,160 After: *WIRE HARNESS,, ,20403,16 ,20400,7 ,WX12-0,35

Re: Regex help for huge csv file

2009-07-15 Thread Blake M. Sisco
Tim, It didn't grow an extra comma it just moved the one from infront to behind the word. That is where the problem lies. The Part Numbers (ones that consist of numbers and those that consist of words, i.e. WIRE HARNESS) need to be the first column. There are only a few PNs that consist of

Re: Regex help for huge csv file

2009-07-15 Thread Tim Chase
Before: *,WIRE HARNESS, [snip] After: *WIRE HARNESS,, [snip] While I'm not sure what transformation you *want* from this data, the following turns your *before* into your *after* form: :g/^,.*[^,],$/d with the exception of the weirdness where the first *WIRE HARNESS, line grew an

Re: Regex help for huge csv file

2009-07-15 Thread Ben Fritz
On Jul 15, 9:21 am, Tim Chase v...@tim.thechases.com wrote: PS: when sending messages to the list, inline replies are greatly preferred for clarity over top-posting's Jeopardy-style read. While you're at it...if you are able to trim off your company disclaimer at the end, it does get a

Re: Regex help for huge csv file

2009-07-15 Thread Blake M. Sisco
PS: when sending messages to the list, inline replies are greatly preferred for clarity over top-posting's Jeopardy-style read. While you're at it...if you are able to trim off your company disclaimer at the end, it does get a little annoying. Seeing as how this is a publicly viewable

Re: Regex help for huge csv file

2009-07-14 Thread Blake M. Sisco
John, Sorry about that. Here's a set of examples Before: *,WIRE HARNESS, ,20403,16 ,FIBERGLASS, ,100 FOOT, ,20400,7 ,FIBERGLASS, ,250 FOOT SPOOL, ,WX12-0,35 ,WX14-1BR/YLW,160 ,YELLOW STRIPE, ,87K 7267,16 ,SINGLE TWISTED PAIR SHIELDED, ,WITH DRAIN, ,32206,5 ,RING NON INS., ,DT06-3S,4 ,W3S,2

Regex help for huge csv file

2009-07-13 Thread bsisco
Hi all, Here's my problem. I have a csv file that has just over 21k lines. It's basically a bom list for some of our products. It contains: -Product P/N |--Component P/N, Component QTY |--Misc. info that is not needed What I need to do is remove all the extraneous data so that only the Product

RE: Regex help for huge csv file

2009-07-13 Thread John Beckett
bsisco wrote: Here's my problem. I have a csv file that has just over 21k lines. It's basically a bom list for some of our products. It contains: -Product P/N |--Component P/N, Component QTY |--Misc. info that is not needed It's too hard to decode your example. A simpler 'before and