Re: [WebDNA] Grep
This WebDNA talk-list message is from 2009
It keeps the original formatting.
numero = 103978
interpreted = N
texte = > I have the following code that combines two database fields into one =20=> and removes extra spaces at the same time. But this seems to also =20> be removing the + (plus symbol) from the data as well, which I don't =20=> want to happen. Example, the data =93DVD+RW=94 becomes =93DVD RW=94. =Any =20> ideas why this might be happening?>> [!]First - Find blank Title fields and fill them in with =20> Description1 and Description2 (using grep to remove extra spaces)[/!]> [Search db=3Dprice2.txt&eqTitledata=3D[blank]][numfound]> [ReplaceFoundItems]Title=3D[grep search=3D =*$&replace=3D][Description1][/=20> grep] [grep search=3D *$&replace=3D][Description2][/grep][/=20> ReplaceFoundItems]> [/Search]This worked for me: (removes all spaces and leaves plus signs intact.[grep search=3D[URL][ ]+[/URL]&replace=3D]DVD + RW[/grep](I don't know enough about the differences between BBedit's grep =20engine and webdna's to know why the asterick did not work for finding =20='zero or instances of', thus my use of the + char.------------Govindagovinda.webdnatalk@gmail.com
Associated Messages, from the most recent to the oldest:
> I have the following code that combines two database fields into one =20=> and removes extra spaces at the same time. But this seems to also =20> be removing the + (plus symbol) from the data as well, which I don't =20=> want to happen. Example, the data =93DVD+RW=94 becomes =93DVD RW=94. =Any =20> ideas why this might be happening?>>
[!]First - Find blank Title fields and fill them in with =20> Description1 and Description2 (using grep to remove extra spaces)[/!]> [Search db=3Dprice2.txt&eqTitledata=3D[blank]][numfound]>
[replacefounditems]Title=3D[grep search=3D =*$&replace=3D][Description1][/=20> grep] [grep search=3D *$&replace=3D][Description2][/grep][/=20> ReplaceFoundItems]> [/Search]This worked for me: (removes all spaces and leaves plus signs intact.[grep search=3D
[url][ ]+[/URL]&replace=3D]DVD + RW[/grep](I don't know enough about the differences between BBedit's grep =20engine and webdna's to know why the asterick did not work for finding =20='zero or instances of', thus my use of the + char.------------Govindagovinda.webdnatalk@gmail.com
Govinda
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:
[WebDNA] passing a variable in an include - precedence (2017)
stuck time (1998)
multiple db's (2003)
[SameAsShipping] (2005)
Message Board (2001)
Sort Order on a page search (1997)
WebCatalog for guestbook ? (1997)
Re:Dumb Question about Docs (1997)
It just Does't add up!!! (1997)
Closing Databases (1998)
WebCat2b12 - New features for 1.6 users ... (1997)
Width & Height (1998)
Date search bug? (1998)
WebCatalog Hosting (1996)
japanese characters (1997)
Security Issue (1997)
Bug Report, maybe (1997)
multi-paragraph fields (1997)
REPOST: Large founditems loops (2000)
2.1 Stuff (1998)