Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: Compare 2 Compare 2 CSV files and create a new CSV file out of comparision

by Tux (Canon)
on Jan 20, 2014 at 07:13 UTC ( [id://1071278]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Compare 2 CSV files and create a new CSV file out of comparision
in thread Compare 2 CSV files and create a new CSV file out of comparision

Overly complicated. Why use file and file1? That doesn't say anything in the queries, making them hard to read.

my $dbh = DBI->connect ("dbi:CSV:", undef, undef, { f_dir => ".", f_ext => ".csv/r", RaiseError => 1, PrintError => 1, }) or die "Could not open database: $DBI::errstr"; my $result = $dbh->selectall_arrayref (join " " => "SELECT vm.vm_name, vm_cluster, vFiler_IP, vFiler_cluster", "FROM vm JOIN vfiler_ds", "WHERE vm.vm_name = vfiler_ds.vm_name");

Using f_ext - which you already do - just add /r to make the extension required, and just use the file names as table names in the query.

As the f_*** attributes are just DBI attributes (passed to DBD::File eventually), you can put RaiseError and other DBI attributes in the same hash.


Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-23 20:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found