in reply to Re^3: Perl Script performance issue
in thread Perl Script performance issue

primary key can be same for many fields. For example: here second column would be acct number 1234, so in order to fetch details for that acct only, i am grepping that acct number (which returns single record) and then select columns as specified. Here
LOC CODE|positionfile.delim|2|47
LOC NAME|locationfile.delim|47|4
For loc code, use second column from main file as primary key for looking up positionfile.delim, get 47th field.
For loc name, 47th column from main file is primary key for looking up locationfile.delim, get the 4th field.

Replies are listed 'Best First'.
Re^5: Perl Script performance issue
by poj (Abbot) on Dec 16, 2015 at 09:05 UTC
    For loc code, use second column from main file
    So in positionfile.delim one record provides 3 fields with the same key from column 2 of main file
    Column Field 6 ACCT NUMBER| 3 PO TYPE 47 LOC CODE
    Is the key always column 1 in the 3 lookup files
    positionfile.delim,accountfile.delim and securityfile.delim ?
    How many records in the main file ?
    Update : Try this. Opening the files just once and caching the search results might improve performance.
    poj