#!/usr/bin/perl $input = @ARGV[0]; open (INFILE, $input) || die "Unable to open @ARGV[0]!\n"; @lines = <INFILE>; close(INFILE); $output = ">output.txt"; open (OUTFILE, $output) || die "Unable to open output.txt!\n"; $frontfill = "INSERT INTO urls (URL, CATEGORY) VALUES ('"; $backfill = "', 'General');"; foreach (@lines) { chomp($lines[$x]); print OUTFILE $frontfill; print OUTFILE $lines[$x]; print OUTFILE $backfill; print OUTFILE "\n"; $x++; } close(OUTFILE);
In reply to parsing error? by bagelesque
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |