Created
December 7, 2016 00:21
-
-
Save JEEN/fe1d9e2893c3282378266714b520ec6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Text::CSV_XS; | |
use Data::Printer; | |
my $csv = Text::CSV_XS->new({ binary => 1, sep_char => "\t" }); | |
open my $fh, "<", $ARGV[0] or die $!; | |
open my $fh2, "<", $ARGV[1] or die $!; | |
# 1. 키맵 생성 | |
my %map = (); | |
while(my $row = $csv->getline($fh)) { | |
$map{$row->[0]} = $row->[1]; | |
} | |
my $count = 0; | |
while(my $row = $csv->getline($fh2)) { | |
$row->[0] = $map{$row->[0]} ? $map{$row->[0]} : $row->[0]; | |
print join("\t", @{ $row })."\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment