-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbasic_script.pl
More file actions
executable file
·76 lines (64 loc) · 1.19 KB
/
Copy pathbasic_script.pl
File metadata and controls
executable file
·76 lines (64 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/perl
#---------------------------------
# Copyright 2012 ByWater Solutions
#
#---------------------------------
#
# -<original author>
#
# Modification log: (initial and date)
#
#---------------------------------
#
# EXPECTS:
# -nothing
#
# DOES:
# -nothing
#
# CREATES:
# -nothing
#
# REPORTS:
# -nothing
use autodie;
use strict;
use warnings;
use Carp;
use Data::Dumper;
use English qw( -no_match_vars );
use Getopt::Long;
use Readonly;
use Text::CSV_XS;
local $OUTPUT_AUTOFLUSH = 1;
Readonly my $NULL_STRING => q{};
my $debug = 0;
my $doo_eet = 0;
my $i = 0;
my $j = 0;
my $k = 0;
my $written = 0;
my $problem = 0;
my $input_filename = $NULL_STRING;
GetOptions(
'in=s' => \$input_filename,
'debug' => \$debug,
'update' => \$doo_eet,
);
for my $var ($input_filename) {
croak ("You're missing something") if $var eq $NULL_STRING;
}
LINE:
while (my $line=$csv->getline($input_file)) {
$i++;
print '.' unless ($i % 10);
print "\r$i" unless ($i % 100);
my @data = @$line;
}
close $input_file;
print << "END_REPORT";
$i records read.
$written records written.
$problem records not loaded due to problems.
END_REPORT
exit;