Re: Grep Master Needed

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 52463
interpreted = N
texte = This works for your situation: [grep search=3D(]*>)([^<]*)([^>]*>)&replace=3D\1\2\3\2\4\5\6] Make sure to enclose the text where the replacements will occur in a raw context. If you have problems, let me know. The explanation that's simplest is that each set of parentheses matches a portion of your text. The part that had to be repeated (the country name) gets isolated in the second parentheses. Then each parentheses is repeated in the replace text but you needed an extra country name so that=B9s why the second paren is repeated twice. Bill on 8/22/03 4:01 PM, Clint Davis at cdavis@grayloon.com wrote: > Bill, >=20 > This worked great, but I wish I understood it. Because now I need to conv= ert > this: > >=20 > Into this: > >=20 > Help :) >=20 >=20 >=20 > On 8/22/03 2:18 PM, "devaulw@onebox.com" wrote: >=20 >> [grep search=3D(> value=3D")([^"]*)(">)([^<]*)()&replace=3D\1\2\3\2\4\5] >> [/grep] >>=20 >>=20 >> -----Original Message----- >> From: Clint Davis >> Sent: Fri, 22 Aug 2003 13:58:46 -0500 >> To: (WebDNA Talk) >> Subject: Grep Master Needed >>=20 >> I need to convert a series of countries in a text file from this: >> >> >>=20 >> To this: >> >> >>=20 >> Anyone?=20 >=20 >=20 > --------------------------------------------------------------------- > Clint Davis > Webmaster / Interactive Media Specialist > Gray Loon Marketing Group, Inc. http://www.grayloon.com > 204 Main Street | Evansville, IN 47708 | Phone:812-422-9999 > --------------------------------------------------------------------- >=20 >=20 > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Grep Master Needed ( William DeVaul 2003)
  2. Re: Grep Master Needed ( Clint Davis 2003)
  3. Re: Grep Master Needed ( Clint Davis 2003)
  4. Re: Grep Master Needed ( devaulw@onebox.com 2003)
  5. Grep Master Needed ( Clint Davis 2003)
This works for your situation: [grep search=3D(]*>)([^<]*)([^>]*>)&replace=3D\1\2\3\2\4\5\6] Make sure to enclose the text where the replacements will occur in a raw context. If you have problems, let me know. The explanation that's simplest is that each set of parentheses matches a portion of your text. The part that had to be repeated (the country name) gets isolated in the second parentheses. Then each parentheses is repeated in the replace text but you needed an extra country name so that=B9s why the second paren is repeated twice. Bill on 8/22/03 4:01 PM, Clint Davis at cdavis@grayloon.com wrote: > Bill, >=20 > This worked great, but I wish I understood it. Because now I need to conv= ert > this: > >=20 > Into this: > >=20 > Help :) >=20 >=20 >=20 > On 8/22/03 2:18 PM, "devaulw@onebox.com" wrote: >=20 >> [grep search=3D(> value=3D")([^"]*)(">)([^<]*)()&replace=3D\1\2\3\2\4\5] >> [/grep] >>=20 >>=20 >> -----Original Message----- >> From: Clint Davis >> Sent: Fri, 22 Aug 2003 13:58:46 -0500 >> To: (WebDNA Talk) >> Subject: Grep Master Needed >>=20 >> I need to convert a series of countries in a text file from this: >> >> >>=20 >> To this: >> >> >>=20 >> Anyone?=20 >=20 >=20 > --------------------------------------------------------------------- > Clint Davis > Webmaster / Interactive Media Specialist > Gray Loon Marketing Group, Inc. http://www.grayloon.com > 204 Main Street | Evansville, IN 47708 | Phone:812-422-9999 > --------------------------------------------------------------------- >=20 >=20 > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ William DeVaul

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

ShipCost Problems (1998) Format all of a sudden doesn't work (1997) encrypting templates (2000) 2.0 Info (1997) OT: [WAY IN RIGHT FIELD SOMEWHERE] Spam Filters (2005) AOL and [redirect] (2000) Nested [SEARCH] and [REPLACE] problem. (1997) WebTen? (1997) Credit Card Processing (2000) problems with 2 tags shakur (1997) [addlineitems] (1997) Banners and sort of random display (1997) Reversed words (1997) Cookie Problems (2000) WEBDNA-MAMP (Mac OSX 10.3.9) (2006) cannot delete last admin (1999) RE: WebCat name recognition (was MacFinder -- a new WebDNAweb site) (1998) My new discussion forum (2003) Cybersource and WebCat ... again (2000) [ShowNext] feature in 2.0 (1997)