Pipeline/Input/File/Table.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 22 / 22 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Pipeline/Input.pm ↑ Summary Pipeline/Input/UnitTest.pm »
1 =pod
2
3 =head1 NAME
4
5 ETL::Pipeline::Input::File::Table - Sequential input in rows and columns
6
7 =head1 SYNOPSIS
8
9 # In the input source...
10 use Moose;
11 with 'ETL::Pipeline::Input';
12 with 'ETL::Pipeline::Input::File';
13 with 'ETL::Pipeline::Input::File::Table';
14 ...
15
16 =head1 DESCRIPTION
17
18 CSV (comma separated values) or Excel spreadsheet files represent data in a
19 table structure. Each row is a record. Each column an individual field. This
20 role provides some attributes common for this type of data. That way you don't
21 have to reinvent the wheel every time.
22
23 =cut
24
25 package ETL::Pipeline::Input::File::Table;
26
27 3 ▶use 5.014000;
Subroutine BEGIN: called CC=1 SCAR=0.0
28
29 3 ▶use List::AllUtils qw/indexes/;
Subroutine BEGIN: called CC=1 SCAR=0.0
30 3 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 3 ▶use String::Util qw/hascontent trim/;
Subroutine BEGIN: called CC=1 SCAR=0.0
32
33
34 3 our $VERSION = '2.00';
35
36
37 =head1 METHODS & ATTRIBUTES
38
39 =head2 Arguments for L<ETL::Pipeline/input>
40
41 =head3 no_column_names
42
43 Tabular data usually has field names in the very first row. This makes it
44 easier for a human being to read. Sometimes, though, there are no field names.
45 The data starts on the very first row.
46
47 Set B<no_column_name> to B<true> for these cases. Otherwise, the input source
48 will load your first row of data as field names.
49
50 $etl->input( 'Excel', no_column_names => 1 );
51
52 =cut
53
54 3 has 'no_column_names' => (
55 default => 0,
56 is => 'ro',
57 isa => 'Bool',
58 );
59
60
61 =head1 SEE ALSO
62
63 L<ETL::Pipeline>, L<ETL::Pipeline::Input>, L<ETL::Pipeline::Input::File>
64
65 =head1 AUTHOR
66
67 Robert Wohlfarth <robert.j.wohlfarth@vumc.org>
68
69 =head1 LICENSE
70
71 Copyright 2021 (c) Vanderbilt University Medical Center
72
73 This program is free software; you can redistribute it and/or modify it under
74 the same terms as Perl itself.
75
76 =cut
77
78 3 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
79
80 # Required by Perl to load the module.
81 3 1;
« Pipeline/Input.pm ↑ Summary Pipeline/Input/UnitTest.pm »