Make insert statements
1 files changed, 11 insertions(+), 1 deletions(-)

M bin/overham/iso.pl
M bin/overham/iso.pl +11 -1
@@ 25,7 25,8 @@ sub main {
 			$col++;
 			$col = 0 if ($col == 5);
 		}
-		print Dumper \%map;
+		#print Dumper \%map;
+		printInserts(\%map);
 	} else {
 		printf(STDERR "Cannot open '%s' - %s'\n", $FILE, $ERRNO);
 		return 1;

          
@@ 34,4 35,13 @@ sub main {
 	return 0;
 }
 
+sub printInserts {
+	my ($map) = @_;
+
+	while (my ($cc, $name) = each(%$map)) {
+		printf("INSERT INTO countries (code, name) VALUES('%s', '%s');\n",
+		    $cc, $name);
+	}
+}
+
 exit(main());