Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: An odd flat file database question

by ftforger (Sexton)
on Feb 09, 2001 at 00:38 UTC ( #57257=note: print w/replies, xml ) Need Help??


in reply to An odd flat file database question

While your db may have other problems (which others have made suggestions about) I'll answer with one method of doing what you are asking for. Load your file into @array. Then start from the top of the array looking for a match on your first key. The first match is the starting index for your output. Next, use a reverse for loop, ie start at the last line of the array and decrement by one, until you get a match. That is the last line you want to output. Then simply print out everything from your first index to your second index. A quick fix that will hold off the dogs while you are learning to program a real dbi.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://57257]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2022-05-18 19:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (71 votes). Check out past polls.

    Notices?