Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 ( [id://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?

Replies are listed 'Best First'.
Re: How do I redirect to multiple output files based on the input file?
by jdporter (Paladin) on Aug 08, 2012 at 12:45 UTC
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 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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-04-19 16:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found