For Tux:
#!/usr/bin/env perl -l use strict; use warnings; use Text::CSV; my $csv = Text::CSV::->new(); my $cols = @{ $csv->getline(\*DATA) }; my $query = 'INSERT INTO table (' . join(',' => map { "col$_" } 1 .. $ +cols) . ') VALUES (' . join(',' => ('?') x $cols) . ')'; print $query; __DATA__ a,b,c,d [download]
Output:
INSERT INTO table (col1,col2,col3,col4) VALUES (?,?,?,?) [download]
www.com | www.net | www.org
5.003 (Camel Book 2nd Edition) 5.6 (Camel Book 3rd Edition) 5.8 (stable version for >5 years) 5.10 (many new features now in common use) 5.16 (Camel Book 4th Edition) 5.18 (hash overhaul) 5.26 (no "." in @INC) 5.36 (subroutine signatures) Dynamic (no standard; code dictates VERSION) Other (discuss in comments)
Results (41 votes). Check out past polls.