[prog] Introduction and Perl: Flat File DB Query Question

Sabine Konhaeuser sjmk at gmx.net
Wed Mar 15 08:58:46 EST 2006


On Tuesday 14 March 2006 20:33, Kathryn Andersen wrote:
> On Tue, Mar 14, 2006 at 07:07:28PM +0000, Sabine Konhaeuser wrote:
> [snip]
>
> > $rc_data is the text file that holds the store locations delimited with
> > pipes. $zipdb is the zip dbm holding zip codes and their longitudes and
> > latitudes.
> >
> > What happens is that both locations (1 and 2 from the above example) are
> > displayed when j=0 and also when j=1, but I would only want to have each
> > location displayed once, not twice.
> >
> > My question is now, how do I force this code to not show duplicates? In
> > SQL I use DISTINCT. Is there some equivalent to DISTINCT for getting
> > results in flat text files? I could not find anything online. At this
> > time a DB driven approach is unfortunately not an option for this client.
>
> No, there isn't a DISTINCT equivalent, you're just reading in lines from
> the file.  You would have to do it programatically.
>
> Kathryn Andersen

Kathryn,

Where would I start? I'm sort of lost with the whole text file thing.

Cheers,

-- 
Sabine Konhaeuser


More information about the Programming mailing list