P is for Practical | |
PerlMonks |
accessing/printing specific rows in a flat file DBby Anonymous Monk |
on Aug 01, 2003 at 16:06 UTC ( [id://280026]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have a flat-file DB and I want the script to just access the rows starting with the prefix “B00” so that when I print the data in a HTML file it DOES'NT print ALL the records. The code I am using is
The database I am using is a flat file one like below but much much bigger, called “products” B001|72.00|65.00|Medicine Hands|Book|medicinehands.gif|medicinehands.html B002|72.00|65.00|Amma Therapy|Book|medicinehands.gif|medicinehands.html C001|55.00|65.00|T-shirt|Clothing|tshirt.gif|tshirt.html C001|100.00|200.00|Jacket|Clothing|jacket.gif|jacket.html X001|400.00|567.00|Golf Clubs|Sport|golf.gif|golf.html When I print the data in the HTML file it prints all the records. I.e. when I use the following command print qq~ $itemName, $nmPrice ~; it prints… Medicine Hands, 72.00 Amma Therapy, 72.00 T-shirt, 55.00 Jacket, 100.00 Golf Clubs, 400.00 I only want to access the rows starting with the prefix “B00” so that it prints only Medicine Hands, 72.00 Amma Therapy, 72.00 Thanx in advance Mark inlimbo17@hotmail.com
Back to
Seekers of Perl Wisdom
|
|