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:[grepsearch=^([0-9A-Z][0-9A-Z])([0-9A-Z][0-9A-Z][0-9A-Z])[^ ]*&replace=\1/\2/][SKU][/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 andreplace 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 AMSubject: 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][/grep]>> 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:
This will work:[grepsearch=^([0-9A-Z][0-9A-Z])([0-9A-Z][0-9A-Z][0-9A-Z])[^ ]*&replace=\1/\2/][SKU][/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 andreplace 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 AMSubject: 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][/grep]>> 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:
two unique banners on one page (1997)
Moment of Thanks (1997)
web merchant (2000)
Bug Report, maybe (1997)
possible, WebCat2.0 and checkboxes-restated (1997)
Newbie Question about seeting price to 0 (1998)
Fun with Dates - finally resolved but.... (1997)
WebCat2 Append problem (B14Macacgi) (1997)
Date Formats (1997)
Whats wrong with this code? (1998)
Another bug to squash (WebCat2b13 Mac .acgi) (1997)
Text data with spaces in them... (1997)
headers (2000)
FW: Shipping calculations (1997)
Server Freeze (1998)
RE: pricing continued (1998)
webcat license???? (1997)
search results not sorted with 'cl' (1998)
Problems with [Applescript] (1997)
SV: Send massmail (2000)