| 1 | package App::CSVUtils::csv_csv; | ||
| 2 | |||
| 3 | 4 | ▶ | use 5.010001; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 4 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 4 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |
| 8 | 4 | our $DATE = '2026-07-09'; # DATE | |
| 9 | 4 | our $DIST = 'App-CSVUtils'; # DIST | |
| 10 | 4 | our $VERSION = '1.038'; # VERSION | |
| 11 | |||
| 12 | 4 | ▶ | use App::CSVUtils qw( |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | gen_csv_util | ||
| 14 | 4 | ); | |
| 15 | |||
| 16 | gen_csv_util( | ||
| 17 | name => 'csv_csv', | ||
| 18 | summary => 'Convert CSV to CSV', | ||
| 19 | description => <<'MARKDOWN', | ||
| 20 | |||
| 21 | Why convert CSV to CSV? When you want to change separator/quote/escape | ||
| 22 | character, for one. Or you want to remove header or add one. | ||
| 23 | |||
| 24 | Example: | ||
| 25 | |||
| 26 | # in.csv | ||
| 27 | name,age | ||
| 28 | andi,12 | ||
| 29 | budi,13 | ||
| 30 | |||
| 31 | % csv-csv in.csv --output-sep-char ';' | ||
| 32 | name;age | ||
| 33 | andi;12 | ||
| 34 | budi;13 | ||
| 35 | |||
| 36 | MARKDOWN | ||
| 37 | add_args => { | ||
| 38 | }, | ||
| 39 | tags => ['category:converting','category:munging'], | ||
| 40 | |||
| 41 | 4 | ▶ | on_input_data_row => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 42 | 4 | my $r = shift; | |
| 43 | |||
| 44 | 4 | $r->{code_print_row}->($r->{input_row}); | |
| 45 | }, | ||
| 46 | 4 | ); | |
| 47 | |||
| 48 | 4 | 1; | |
| 49 | # ABSTRACT: Convert CSV to CSV | ||
| 50 | |||
| 51 | __END__ | ||