Gossamer Forum
Home : Products : DBMan : Customization :

dbman and grep / awk?

Quote Reply
dbman and grep / awk?
Hi Guys, I'm using dbman to edit a large database file and it works slick. Now I'd like to teach it another trick. The database file is the master product file for a shopping cart cgi program. When something goes "sold-out" we use dbman to add a graphic to the name of the item. Hence, "Blue Gloves" become "Blue Gloves<img src=SOLD_OUT.gif>" (We just paste the tag info into the name field behind the item name)

This works just fine. Now for the new trick.

We allow people to add items to a shopping cart and return to the store at a later date. The cart stores the info in a simple text file, with a unique file name for each shopper, in a special directory. What I'd like to do is have dbman make the changes to the master product list, as it is already doing, but then, using grep or awk or something like that, search this cart directory and replace all "blue gloves" with "blue gloves<img src=SOLD_OUT.gif>" I'd like it to mirror the changes we make to the main product data base file.

The idea is to allow people to add items to the shopping cart over time, but if something in their cart is sold out before they finalize the order, then I'd like that updated in the cart file.

It seems like it should be pretty simple, smile, but I'm pretty simple as well and haven't been able to sort this. Thanks in advance for any thoughts or suggestions.
Subject Author Views Date
Thread dbman and grep / awk? steven99 3373 Mar 13, 2007, 8:54 AM
Thread Re: [steven99] dbman and grep / awk?
steven99 3310 Mar 13, 2007, 12:45 PM
Thread Re: [steven99] dbman and grep / awk?
Watts 3343 Mar 14, 2007, 12:09 PM
Thread Re: [Watts] dbman and grep / awk?
steven99 3300 Mar 15, 2007, 12:34 PM
Post Re: [steven99] dbman and grep / awk?
Watts 3303 Mar 16, 2007, 8:37 AM