Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: An odd flat file database question

by ftforger (Sexton)
on Feb 09, 2001 at 00:38 UTC ( [id://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?

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-07-24 02:32 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.