Re: Removing a character

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 27920
interpreted = N
texte = >>>What is the smallest amount of code (please show) that you can write to >>>accomplish this simple task: >>> >>>You are given a database containing a field of data left padded by zeros >>>that you need to clean out. Example: >>> >>>Given -> What you want >>>----- ------------- >>>00B B >>>BLK BLK >>>BL0 BL0 >>>0BT BT >>>0Y0 Y0 >>> >>>Any quick ideas (looking for least processor intensive, and prefer to avoid >>>a lookup or looping convertchars)? >> >> Do you want to get rid of the leading zeros just once, so you can generate >> a new db without the leading zeros in it, then use the new database from then >on? >> >> Kenneth Grome, WebDNA Consultant > >Good question. In this case, no. I want to take two fields (one numeric, and >one alphanumeric (but left padded with zeros) and combine then (without the >left padded zeros) into a new third field in a database of 64000 records >4-12 times a day. > >(it's an incoming file that gets processed and posted.)I don't remember the code the other person posted as an answer to your question, but here's my first thought:[spawn] [search] [founditems] [showif [given]~0][text]newValue=[getchars start=2][given][/getchars][/text] [text]loopCount=[countchars][newValue][/countchars][/text][loop start=1&end=[loopCount]] [showif [newValue]~0] [text]newValue=[getchars start=2][newValue][/getchars][/text] [/showif] [/loop][replace db=some.db&eqskudatarq=[sku]&max=1]whatYouWant=[numericField][newValue][/replace][/showif] [/founditems] [/search] [/spawn]================================ Kenneth Grome, WebDNA Consultant 808-737-6499 http://webdna.net ================================------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .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 Associated Messages, from the most recent to the oldest:

    
  1. Re: Removing a character (Kenneth Grome 2000)
  2. Re: Removing a character (Rob Marquardt 2000)
  3. Re: Removing a character (Brian B. Burton 2000)
  4. Re: Removing a character (Michael Winston 2000)
  5. Re: Removing a character (Kenneth Grome 2000)
  6. Removing a character (Brian B. Burton 2000)
>>>What is the smallest amount of code (please show) that you can write to >>>accomplish this simple task: >>> >>>You are given a database containing a field of data left padded by zeros >>>that you need to clean out. Example: >>> >>>Given -> What you want >>>----- ------------- >>>00B B >>>BLK BLK >>>BL0 BL0 >>>0BT BT >>>0Y0 Y0 >>> >>>Any quick ideas (looking for least processor intensive, and prefer to avoid >>>a lookup or looping convertchars)? >> >> Do you want to get rid of the leading zeros just once, so you can generate >> a new db without the leading zeros in it, then use the new database from then >on? >> >> Kenneth Grome, WebDNA Consultant > >Good question. In this case, no. I want to take two fields (one numeric, and >one alphanumeric (but left padded with zeros) and combine then (without the >left padded zeros) into a new third field in a database of 64000 records >4-12 times a day. > >(it's an incoming file that gets processed and posted.)I don't remember the code the other person posted as an answer to your question, but here's my first thought:[spawn] [search] [founditems] [showif [given]~0][text]newValue=[getchars start=2][given][/getchars][/text] [text]loopCount=[countchars][newValue][/countchars][/text][loop start=1&end=[loopCount]] [showif [newValue]~0] [text]newValue=[getchars start=2][newValue][/getchars][/text] [/showif] [/loop][replace db=some.db&eqskudatarq=[sku]&max=1]whatYouWant=[numericField][newValue][/replace][/showif] [/founditems] [/search] [/spawn]================================ Kenneth Grome, WebDNA Consultant 808-737-6499 http://webdna.net ================================------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .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 Kenneth Grome

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:

customizing the color of user's pages (1997) order problem (2006) Error handling for accountNum (1997) system crashes, event log (1997) shownext problems (1998) [WebDNA] An apache config file that works? (2013) Typhoon Rev. and PCS store problems (1999) WebCat2: Items xx to xx shown, etc. (1997) Another question about credit cards (1997) Requiring that certain fields be completed (1997) Non expiring cookies again (*sorry*) (1999) Post arguments problem mac? (1997) pc (1997) SiteEdit NewFile.html ? (1997) [WebDNA] autonumber duplication, time stamp issue & locking up (2010) More than one db with the same namn (was: WC2f3) (1997) Undocumented changes create problems in webcat 4 ... (2000) Opinion: [input] should be called [output] ... (1997) question: search return in order (1997) On a related topic (2006)