| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Acme::CPANModules::WorkingWithCSV; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
262746
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
34
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
6099
|
use Acme::CPANModulesUtil::Misc; |
|
|
1
|
|
|
|
|
520
|
|
|
|
1
|
|
|
|
|
124
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY |
|
8
|
|
|
|
|
|
|
our $DATE = '2023-10-31'; # DATE |
|
9
|
|
|
|
|
|
|
our $DIST = 'Acme-CPANModules-WorkingWithCSV'; # DIST |
|
10
|
|
|
|
|
|
|
our $VERSION = '0.003'; # VERSION |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my $text = <<'_'; |
|
13
|
|
|
|
|
|
|
The following are tools (modules and scripts) to work with the CSV format: |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
**Parsing** |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
First things first, the most important module to work with CSV in Perl is |
|
19
|
|
|
|
|
|
|
(which will use backend when possible but fall |
|
20
|
|
|
|
|
|
|
back to otherwise). It's not in core, but only a cpanm command |
|
21
|
|
|
|
|
|
|
away. |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
**Generating CSV from Perl array/structure** |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
(as well as ) can render a line of CSV from Perl |
|
27
|
|
|
|
|
|
|
array(ref) with their `say()` method. |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
from |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
framework can render function result (CLI output) as CSV. |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
**Converting to/from other formats** |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
*INI*: from |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
*TSV*: and L from |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
*LTSV*: from and L from |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
*XLS* and *XLSX*: and from |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
*JSON*: and from |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
*Markdown table*: from |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
*Org table*: from |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
*SQLite database*: from |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
**Rendering as text/ASCII table** |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
from |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
**Changing field separator character, field quote character, and/or escape character** |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
from |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
**Adding/removing columns** |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
, , from |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
**Processing columns of CSV with Perl code** |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
from |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
**Processing rows of CSV with Perl code** |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Aside from the obvious , you can also use , |
|
78
|
|
|
|
|
|
|
, from . |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
**Merging rows from several CSV files into one** |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
, from |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
**Splitting a CSV file into several** |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
from |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
**Sorting CSV rows** |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
from |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
**Sorting CSV columns** |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
from |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
**Filtering CSV columns** |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
from |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
**Filtering CSV rows** |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
and from |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
from |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
**Transposing CSV** |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
from |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
**Summing and averaging rows** |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
and from |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
**Producing frequency table from CSV** |
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
from |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
**Performing set operations (intersection, union, difference) on CSV** |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
from |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
** Other modules/unorganized |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
_ |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
our $LIST = { |
|
140
|
|
|
|
|
|
|
summary => 'List of modules/applications to work with CSV (comma-separated value) data in Perl', |
|
141
|
|
|
|
|
|
|
description => $text, |
|
142
|
|
|
|
|
|
|
tags => ['task'], |
|
143
|
|
|
|
|
|
|
}; |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
Acme::CPANModulesUtil::Misc::populate_entries_from_module_links_in_description; |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
1; |
|
148
|
|
|
|
|
|
|
# ABSTRACT: List of modules/applications to work with CSV (comma-separated value) data in Perl |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
__END__ |