Re: grep is really pathetic sometimes

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 51322
interpreted = N
texte = This will work: [grep search=^([0-9A-Z][0-9A-Z])([0-9A-Z][0-9A-Z][0-9A-Z])[^ ]*&replace=\1/\2/][SK U][/grep] because grep doesn't exactly 'pull out' portions of the text, it just 'replaces' it. So I added "[^ ]*" to basically mask the remaining text and replace with only "\1/\2/". I'm not sure how it applies to your entire scenario since you might have 'spaces' in your SKU values, but you can use any character. Such as "[^§]*" etc. Raj ----- Original Message ----- From: "John Peacock" To: "WebDNA Talk" Sent: Wednesday, June 25, 2003 10:56 AM Subject: Re: grep is really pathetic sometimes > Rajeev Kumar wrote: > > [Text show=T]SKU=TROUTPRINT.JPG[/Text]

> > [grep > > search=^([A-Z0-9][0-9A-Z])([0-9A-Z][0-9A-Z][0-9A-Z])&replace=\1/\2/][getchar > > s start=1&end=5][SKU][/getchars][/grep] > > > > DOH! That was the working code! Try this and you'll see my problem: > > [Text show=T]SKU=TROUTPRINT.JPG[/Text]

> [grep > search=^([A-Z0-9][0-9A-Z])([0-9A-Z][0-9A-Z][0-9A-Z])&replace=\1/\2/][SKU][/g rep] > > John > > > -- > John Peacock > Director of Information Research and Technology > Rowman & Littlefield Publishing Group > 4720 Boston Way > Lanham, MD 20706 > 301-459-3366 x.5010 > fax 301-429-5747 > > > ------------------------------------------------------------- > 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 is really pathetic sometimes ( John Peacock 2003)
  2. Re: grep is really pathetic sometimes ( "Rajeev Kumar" 2003)
  3. Re: grep is really pathetic sometimes ( John Peacock 2003)
  4. Re: grep is really pathetic sometimes ( "Rajeev Kumar" 2003)
  5. RFE: grep is really pathetic sometimes ( John Peacock 2003)
This will work: [grep search=^([0-9A-Z][0-9A-Z])([0-9A-Z][0-9A-Z][0-9A-Z])[^ ]*&replace=\1/\2/][SK U][/grep] because grep doesn't exactly 'pull out' portions of the text, it just 'replaces' it. So I added "[^ ]*" to basically mask the remaining text and replace with only "\1/\2/". I'm not sure how it applies to your entire scenario since you might have 'spaces' in your SKU values, but you can use any character. Such as "[^§]*" etc. Raj ----- Original Message ----- From: "John Peacock" To: "WebDNA Talk" Sent: Wednesday, June 25, 2003 10:56 AM Subject: Re: grep is really pathetic sometimes > Rajeev Kumar wrote: > > [Text show=T]SKU=TROUTPRINT.JPG[/Text]

> > [grep > > search=^([A-Z0-9][0-9A-Z])([0-9A-Z][0-9A-Z][0-9A-Z])&replace=\1/\2/][getchar > > s start=1&end=5][SKU][/getchars][/grep] > > > > DOH! That was the working code! Try this and you'll see my problem: > > [Text show=T]SKU=TROUTPRINT.JPG[/Text]

> [grep > search=^([A-Z0-9][0-9A-Z])([0-9A-Z][0-9A-Z][0-9A-Z])&replace=\1/\2/][SKU][/g rep] > > John > > > -- > John Peacock > Director of Information Research and Technology > Rowman & Littlefield Publishing Group > 4720 Boston Way > Lanham, MD 20706 > 301-459-3366 x.5010 > fax 301-429-5747 > > > ------------------------------------------------------------- > 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/ "Rajeev Kumar"

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:

WebCat2 - Getting to the browser's username/password data (1997) Random letter and/or number (2001) Ampersand is breaking search context (1999) WebDNA Verison 4.5 will Not Restart! This SUCKS! (2002) Changing price for a SLU based on options (size, etc.) (1997) Separate SSL Server (1997) [WebDNA] Processor Maxing out (2010) Problem displaying search result (1997) WebCat2final1 crashes (1997) Aaron kant add (or whatever it was) (2000) Problems reading files created by WC (1997) Help! WebCat2 bug (Ben's input) (1997) Greeting Card System (2000) Why don't my carts expire (1998) old cart file deletion (2000) Updating a database once per day - An example (1998) Webstar 1.3.1 PPC (1997) Execute Applescript (1997) Need relative path explanation (1997) WebMerchant 1.6 and https (1997)