Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

How do I redirect to multiple output files based on the input file?

by marecaryousuf (Initiate)
on Aug 08, 2012 at 12:24 UTC ( #986246=perlquestion: print w/ replies, xml ) Need Help??
marecaryousuf has asked for the wisdom of the Perl Monks concerning the following question:

I have an input file, which has customer account numbers. I need to lookup another file with this customer account number and get customer details like Name, Address, Fees, etc. Now, based on the fees I need to generate output files (1 file per distict fee). There might be "n" distinct fee and customers with that fee should have a separate file. How do I do this?

Comment on How do I redirect to multiple output files based on the input file?
Re: How do I redirect to multiple output files based on the input file?
by Anonymous Monk on Aug 08, 2012 at 12:29 UTC
Re: How do I redirect to multiple output files based on the input file?
by jdporter (Canon) on Aug 08, 2012 at 12:45 UTC
Re: How do I redirect to multiple output files based on the input file?
by rpnoble419 (Pilgrim) on Aug 09, 2012 at 04:21 UTC
    It seems that this process will quickly become very slow an inefficient. I would suggest that you read your data into a database and then process your output as part of an SQL query. I have to do similar lookups (customer names against sales force records) against thousands of records with my application and having to read account information from one text file and then read and search against another text file would take much more effort, then to read the two source files into a database (SQLite or MySQL) and then run a simple join query and output the results...

    In my application I can read in 10K sales records into my database in about 2 minutes, read in the customer data (1,000,000 records) in about 5 minutes, execute the data merge and output the results in about 5 minutes.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://986246]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2014-07-30 03:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls