in reply to Replace a Hex Value in Column
#!/usr/bin/env perl use warnings; use strict; use Text::CSV; # also install Text::CSV_XS for speed my $infilename = 'in.csv'; my $outfilename = 'out.csv'; my $csv = Text::CSV->new({ binary=>1, auto_diag=>2, eol=>$/, quote_char=>'"', sep_char=>";", always_quote=>1 }); open my $ifh, '<', $infilename or die "$infilename: $!"; open my $ofh, '>', $outfilename or die "$outfilename: $!"; while ( my $row = $csv->getline($ifh) ) { $row->[5] = "BitTorrent"; $csv->print($ofh, $row); } $csv->eof or $csv->error_diag; close $ifh; close $ofh;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Replace a Hex Value in Column
by ktham33n (Novice) on Feb 03, 2018 at 08:08 UTC | |
by haukex (Archbishop) on Feb 03, 2018 at 09:12 UTC | |
by choroba (Cardinal) on Feb 03, 2018 at 10:19 UTC | |
by ktham33n (Novice) on Feb 03, 2018 at 10:54 UTC | |
by ktham33n (Novice) on Feb 03, 2018 at 09:39 UTC | |
by haukex (Archbishop) on Feb 03, 2018 at 09:51 UTC |