Re: [WebDNA] help with writefile

This WebDNA talk-list message is from

2012


It keeps the original formatting.
numero = 110051
interpreted = N
texte = Your solution worked great. Thank you for showing me how to test for [blank] and how to use = replacefounditems. sfb On Dec 19, 2012, at 10:17 AM, WebDNA Solutions = wrote: > If you want to renumber only those records with a value in=20 > the NEWSLETTER field this should work: >=20 > [search db=3Dstory.db[!] > [/!]&neNEWSLETTERdatarq=3D[blank][!] > [/!]&asNEWSLETTERsort=3D1[!] > [/!]&NEWSLETTERtype=3Dnum][!] > [/!][replacefounditems][!] > [/!]NEWSLETTER=3D[index][!] > [/!][/replacefounditems][!] > [/!][/search] >=20 > Sincerely, > Kenneth Grome > WebDNA Solutions > http://www.webdnasolutions.com > WebDNA Programming and Linux Server Administration >=20 >=20 >=20 >=20 >=20 >> Hi Ken, >> Thanks for helping me with this. >> I've worked on it a few more hours, and I'm still having >> difficulties. >>=20 >> I've never used the [replacefounditems] tag before, and I >> can't control what it's doing. Also, I've tried a number >> of different numbers in place of the xxx that you've >> placed in your search command, and I'm not completely >> sure how that's working either. >>=20 >> Each time I run your search command, the >> [replacefounditems] tag seems to update *all* 43 of the >> NEWSLETTER fields. I can't seem to exclude it from >> changing the empty fields or the OFF=3DTRUE fields. >>=20 >> Here's what Im trying to do again: >> I'm trying to search 43 fields named NEWSLETTER in a >> .db named story.db I need to ignore the records if the >> NEWSLETTER =3D I need to ignore the records if the OFF >> field =3D TRUE I need to renumber the NEWSLETTER field >> from >> being 1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18 >> to >> 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 >>=20 >> Thank again for any input. >> sfb >>=20 >> On Dec 18, 2012, at 11:41 AM, WebDNA Solutions=20 > wrote: >>>> You may notice that my .db file has no number 15. >>>> I need this .db file to have these field numbers to be >>>> contiguous. >>>=20 >>> If you want consecutive numbers in the NEWSLETTER field >>> of every record except the OFF=3DTRUE records, try this: >>>=20 >>> [search db=3Dstory.db[!] >>> [/!]&neSTORYNUMBERdatarq=3Dxxx[!] >>> [/!]&neOFFdatarq=3DTRUE[!] >>> [/!]&asNEWSLETTERsort=3D1[!] >>> [/!]&NEWSLETTERtype=3Dnum][!] >>> [/!][replacefounditems][!] >>> [/!]NEWSLETTER=3D[index][!] >>> [/!][/replacefounditems][!] >>> [/!][/search] >>>=20 >>> Or if you want to include the OFF=3DTRUE records simply >>> remove the third line of code above. >>>=20 >>> Sincerely, >>> Kenneth Grome >>> WebDNA Solutions >>> http://www.webdnasolutions.com >>> WebDNA Programming and Linux Server Administration >>>=20 >>>> Therefore, my next step was to add a >>>> comparison between the number written to the file, and >>>> the current number found. If they are found to be more >>>> than one number apart, I would then execute another >>>> step to replace the variable number. >>>>=20 >>>> Unless you know of another way to reorder integer >>>> numbers in a .db field to be in order, without >>>> skipping any..... >>>>=20 >>>> Thanks, >>>> sfb >>>>=20 >>>> On Dec 18, 2012, at 9:59 AM, WebDNA Solutions >>>=20 >>> wrote: >>>>> What are you actually trying to accomplish? You're >>>>> repetitively writing then deleting temporary.txt >>>>> files. Why? >>>>>=20 >>>>> Sincerely, >>>>> Kenneth Grome >>>>> WebDNA Solutions >>>>> http://www.webdnasolutions.com >>>>> WebDNA Programming and Linux Server Administration >>>>>=20 >>>>>> Hi All, >>>>>> Here is my code: (I knew that you would ask) >>>>>>=20 >>>>>> >>>>>>=20 >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>=20 >>>>>> [writefile temporary.txt]0[/writefile] >>>>>>  >>>>>> =09 >>>>>> [search >>>>>>=20 >>>>>> db=3Dstory.db&geSTORYNUMBERdata=3D1&asNEWSLETTERsort=3D1&N >>>>>> EW SL ETTERtype=3Dnum] [founditems] >>>>>>=20 >>>>>> [hideif [OFF]=3DTrue] >>>>>> =09 >>>>>>  >>>>>>  >>>>>> =09 >>>>>>  >>>>>> =09 >>>>>> [/hideif] >>>>>> =09 >>>>>> [/founditems] >>>>>> =09 >>>>>> [/search] >>>>>>=20 >>>>>>
>>>>>> [showif [NEWSLETTER]>0] >>>>>> =09 >>>>>> [include temporary.txt], >>>>>> [deletefile = temporary.txt] >>>>>> [writefile = temporary.txt] >>>>>=20 >>>>> [NEWSLETTER][/writefile] >>>>>=20 >>>>>> [NEWSLETTER] >>>>>> =09 >>>>>> [/showif] >>>>>> 
>>>>>> >>>>>> >>>>>>=20 >>>>>>=20 >>>>>> Here is my db: >>>>>> STORYNUMBEROFFNEWSLETTER >>>>>> 100014 >>>>>> 100112 >>>>>> 1002 >>>>>> 100318 >>>>>> 100413 >>>>>> 100617 >>>>>> 100716 >>>>>> 1009 >>>>>> 1010 >>>>>> 1011 >>>>>> 1012 >>>>>> 1013 >>>>>> 1014 >>>>>> 1015 >>>>>> 10169 >>>>>> 10178 >>>>>> 10186 >>>>>> 101910 >>>>>> 102011 >>>>>> 1021 >>>>>> 1022 >>>>>> 10237 >>>>>> 1024 >>>>>> 1025 >>>>>> 1026 >>>>>> 1027 >>>>>> 1028 >>>>>> 1029 >>>>>> 1030 >>>>>> 1031 >>>>>> 1032 >>>>>> 1033 >>>>>> 1034 >>>>>> 1035 >>>>>> 1036 >>>>>> 1037 >>>>>> 1038 >>>>>> 1039 >>>>>> 10405 >>>>>> 1044TRUE >>>>>> 1045TRUE >>>>>> 10464 >>>>>> 10473 >>>>>> 10482 >>>>>> 10491 >>>>>>=20 >>>>>> Here is my result: >>>>>> 0, 1 >>>>>> 0, 2 >>>>>> 0, 3 >>>>>> 0, 4 >>>>>> 0, 5 >>>>>> 0, 6 >>>>>> 0, 7 >>>>>> 0, 8 >>>>>> 0, 9 >>>>>> 0, 10 >>>>>> 0, 11 >>>>>> 0, 12 >>>>>> 0, 13 >>>>>> 0, 14 >>>>>> 0, 16 >>>>>> 0, 17 >>>>>> 0, 18 >>>>>>=20 >>>>>> Here is my question: >>>>>> Why won't it execute the writefile tag inside of the >>>>>> founditems tag? >>>>>>=20 >>>>>> Thank for any insight. >>>>>> Steve Braun >>>>>=20 >>>>> ----------------------------------------------------- >>>>> -- -- This message is sent to you because you are >>>>> subscribed to the mailing list . To >>>>> unsubscribe, E-mail to: >>>>> archives: http://mail.webdna.us/list/talk@webdna.us >>>>> Bug Reporting: support@webdna.us >>>>=20 >>>> ------------------------------------------------------ >>>> --- This message is sent to you because you are >>>> subscribed to the mailing list . >>>> To unsubscribe, E-mail to: >>>> archives: http://mail.webdna.us/list/talk@webdna.us >>>> Bug Reporting: support@webdna.us >>>=20 >>> ------------------------------------------------------- >>> -- This message is sent to you because you are >>> subscribed to the mailing list . >>> To unsubscribe, E-mail to: >>> archives: http://mail.webdna.us/list/talk@webdna.us >>> Bug Reporting: support@webdna.us > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > Bug Reporting: support@webdna.us Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] help with writefile (WebDNA Solutions 2012)
  2. Re: [WebDNA] help with writefile (Stephen Braun 2012)
  3. Re: [WebDNA] help with writefile (WebDNA Solutions 2012)
  4. Re: [WebDNA] help with writefile (WebDNA Solutions 2012)
  5. Re: [WebDNA] help with writefile (Stephen Braun 2012)
  6. Re: [WebDNA] help with writefile (Iphonzie 2012)
  7. Re: [WebDNA] help with writefile (WebDNA Solutions 2012)
  8. [WebDNA] help with writefile (Stephen Braun 2012)
Your solution worked great. Thank you for showing me how to test for [blank] and how to use = replacefounditems. sfb On Dec 19, 2012, at 10:17 AM, WebDNA Solutions = wrote: > If you want to renumber only those records with a value in=20 > the NEWSLETTER field this should work: >=20 > [search db=3Dstory.db[!] > [/!]&neNEWSLETTERdatarq=3D[blank][!] > [/!]&asNEWSLETTERsort=3D1[!] > [/!]&NEWSLETTERtype=3Dnum][!] > [/!][replacefounditems][!] > [/!]NEWSLETTER=3D[index][!] > [/!][/replacefounditems][!] > [/!][/search] >=20 > Sincerely, > Kenneth Grome > WebDNA Solutions > http://www.webdnasolutions.com > WebDNA Programming and Linux Server Administration >=20 >=20 >=20 >=20 >=20 >> Hi Ken, >> Thanks for helping me with this. >> I've worked on it a few more hours, and I'm still having >> difficulties. >>=20 >> I've never used the [replacefounditems] tag before, and I >> can't control what it's doing. Also, I've tried a number >> of different numbers in place of the xxx that you've >> placed in your search command, and I'm not completely >> sure how that's working either. >>=20 >> Each time I run your search command, the >> [replacefounditems] tag seems to update *all* 43 of the >> NEWSLETTER fields. I can't seem to exclude it from >> changing the empty fields or the OFF=3DTRUE fields. >>=20 >> Here's what Im trying to do again: >> I'm trying to search 43 fields named NEWSLETTER in a >> .db named story.db I need to ignore the records if the >> NEWSLETTER =3D I need to ignore the records if the OFF >> field =3D TRUE I need to renumber the NEWSLETTER field >> from >> being 1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18 >> to >> 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 >>=20 >> Thank again for any input. >> sfb >>=20 >> On Dec 18, 2012, at 11:41 AM, WebDNA Solutions=20 > wrote: >>>> You may notice that my .db file has no number 15. >>>> I need this .db file to have these field numbers to be >>>> contiguous. >>>=20 >>> If you want consecutive numbers in the NEWSLETTER field >>> of every record except the OFF=3DTRUE records, try this: >>>=20 >>> [search db=3Dstory.db[!] >>> [/!]&neSTORYNUMBERdatarq=3Dxxx[!] >>> [/!]&neOFFdatarq=3DTRUE[!] >>> [/!]&asNEWSLETTERsort=3D1[!] >>> [/!]&NEWSLETTERtype=3Dnum][!] >>> [/!][replacefounditems][!] >>> [/!]NEWSLETTER=3D[index][!] >>> [/!][/replacefounditems][!] >>> [/!][/search] >>>=20 >>> Or if you want to include the OFF=3DTRUE records simply >>> remove the third line of code above. >>>=20 >>> Sincerely, >>> Kenneth Grome >>> WebDNA Solutions >>> http://www.webdnasolutions.com >>> WebDNA Programming and Linux Server Administration >>>=20 >>>> Therefore, my next step was to add a >>>> comparison between the number written to the file, and >>>> the current number found. If they are found to be more >>>> than one number apart, I would then execute another >>>> step to replace the variable number. >>>>=20 >>>> Unless you know of another way to reorder integer >>>> numbers in a .db field to be in order, without >>>> skipping any..... >>>>=20 >>>> Thanks, >>>> sfb >>>>=20 >>>> On Dec 18, 2012, at 9:59 AM, WebDNA Solutions >>>=20 >>> wrote: >>>>> What are you actually trying to accomplish? You're >>>>> repetitively writing then deleting temporary.txt >>>>> files. Why? >>>>>=20 >>>>> Sincerely, >>>>> Kenneth Grome >>>>> WebDNA Solutions >>>>> http://www.webdnasolutions.com >>>>> WebDNA Programming and Linux Server Administration >>>>>=20 >>>>>> Hi All, >>>>>> Here is my code: (I knew that you would ask) >>>>>>=20 >>>>>> >>>>>>=20 >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>=20 >>>>>> [writefile temporary.txt]0[/writefile] >>>>>>  >>>>>> =09 >>>>>> [search >>>>>>=20 >>>>>> db=3Dstory.db&geSTORYNUMBERdata=3D1&asNEWSLETTERsort=3D1&N >>>>>> EW SL ETTERtype=3Dnum] [founditems] >>>>>>=20 >>>>>> [hideif [OFF]=3DTrue] >>>>>> =09 >>>>>>  >>>>>>  >>>>>> =09 >>>>>>  >>>>>> =09 >>>>>> [/hideif] >>>>>> =09 >>>>>> [/founditems] >>>>>> =09 >>>>>> [/search] >>>>>>=20 >>>>>>
>>>>>> [showif [NEWSLETTER]>0] >>>>>> =09 >>>>>> [include temporary.txt], >>>>>> [deletefile = temporary.txt] >>>>>> [writefile = temporary.txt] >>>>>=20 >>>>> [NEWSLETTER][/writefile] >>>>>=20 >>>>>> [NEWSLETTER] >>>>>> =09 >>>>>> [/showif] >>>>>> 
>>>>>> >>>>>> >>>>>>=20 >>>>>>=20 >>>>>> Here is my db: >>>>>> STORYNUMBEROFFNEWSLETTER >>>>>> 100014 >>>>>> 100112 >>>>>> 1002 >>>>>> 100318 >>>>>> 100413 >>>>>> 100617 >>>>>> 100716 >>>>>> 1009 >>>>>> 1010 >>>>>> 1011 >>>>>> 1012 >>>>>> 1013 >>>>>> 1014 >>>>>> 1015 >>>>>> 10169 >>>>>> 10178 >>>>>> 10186 >>>>>> 101910 >>>>>> 102011 >>>>>> 1021 >>>>>> 1022 >>>>>> 10237 >>>>>> 1024 >>>>>> 1025 >>>>>> 1026 >>>>>> 1027 >>>>>> 1028 >>>>>> 1029 >>>>>> 1030 >>>>>> 1031 >>>>>> 1032 >>>>>> 1033 >>>>>> 1034 >>>>>> 1035 >>>>>> 1036 >>>>>> 1037 >>>>>> 1038 >>>>>> 1039 >>>>>> 10405 >>>>>> 1044TRUE >>>>>> 1045TRUE >>>>>> 10464 >>>>>> 10473 >>>>>> 10482 >>>>>> 10491 >>>>>>=20 >>>>>> Here is my result: >>>>>> 0, 1 >>>>>> 0, 2 >>>>>> 0, 3 >>>>>> 0, 4 >>>>>> 0, 5 >>>>>> 0, 6 >>>>>> 0, 7 >>>>>> 0, 8 >>>>>> 0, 9 >>>>>> 0, 10 >>>>>> 0, 11 >>>>>> 0, 12 >>>>>> 0, 13 >>>>>> 0, 14 >>>>>> 0, 16 >>>>>> 0, 17 >>>>>> 0, 18 >>>>>>=20 >>>>>> Here is my question: >>>>>> Why won't it execute the writefile tag inside of the >>>>>> founditems tag? >>>>>>=20 >>>>>> Thank for any insight. >>>>>> Steve Braun >>>>>=20 >>>>> ----------------------------------------------------- >>>>> -- -- This message is sent to you because you are >>>>> subscribed to the mailing list . To >>>>> unsubscribe, E-mail to: >>>>> archives: http://mail.webdna.us/list/talk@webdna.us >>>>> Bug Reporting: support@webdna.us >>>>=20 >>>> ------------------------------------------------------ >>>> --- This message is sent to you because you are >>>> subscribed to the mailing list . >>>> To unsubscribe, E-mail to: >>>> archives: http://mail.webdna.us/list/talk@webdna.us >>>> Bug Reporting: support@webdna.us >>>=20 >>> ------------------------------------------------------- >>> -- This message is sent to you because you are >>> subscribed to the mailing list . >>> To unsubscribe, E-mail to: >>> archives: http://mail.webdna.us/list/talk@webdna.us >>> Bug Reporting: support@webdna.us > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > Bug Reporting: support@webdna.us Stephen Braun

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:

Not really WebCat - need HTML Grider (1997) OrdersFolder parm missing and DBServer Access Violations (2000) Plugin or CGI or both (1997) File Upload (1997) Date Formats (1997) combine search (1998) Another webcatalog site!! (1997) Include (1998) Same Table Opened Twice (2003) Sku numbers (1997) Posting form data to a popup (2004) process SSI (1998) FYI-WebCat Mac or NT (1997) [WebDNA] Error 500 with SUMM=T (2017) Cart doesn't interpret tag! (1997) [OT] Security Certs (2000) form data submission gets truncated (1997) Nav. 4 probs with cart (1997) Nested tags count question (1997) [WebDNA] Store module/site (2012)