use strict 'vars'; # 聲明全局變量不會報錯
use warnings;
# 補全到 61000000
use List::MoreUtils qw/all/;
use Spreadsheet::XLSX;
use Excel::Writer::XLSX;
use MyExcelFormatter;
use Encode;
use v5.10;
use Data::Dumper;
my %match;
while(<DATA>){
chomp;
my ($product_code,$product_name)=split(/\s+/,$_,2);
# say $product_code;
$product_name=~s{/}{}g;
# say $product_name;
$match{$product_code}=$product_name;
}
sub H{
my $text = shift;
return decode('utf8',$text); # 進行轉(zhuǎn)碼
}
my $workbook = Excel::Writer::XLSX->new( "模板.xlsx" );
my $excel = Spreadsheet::XLSX -> new ('產(chǎn)品匹配維護.xlsx');
my $n=2;
our $encode_name; # 聲明一個全局變量
sub is{
all {$encode_name =~ /$_/i} @_;
}
my @ID_5300000 = qw( 百多邦 噴霧 70ml );
my @ID_5300000_2 = qw( 百多邦 70ml );
my @ID_5000000 = qw( 莫匹羅星 10g );
my @ID_5000000_2 = qw( 百多邦 10g );
my @ID_02251 = qw( 莫匹羅星 5g );
my @ID_02251_2 = qw( 莫匹羅星軟膏 );
my @ID_02251_3 = qw( 莫匹羅星 5克 );
my @ID_02251_4 = qw( 百多邦膏 5克 );
my @ID_5100000 = qw( 丁酸氯倍他松乳膏 );
my @ID_9090012 = qw( 保麗凈 假牙 局部 贈 24T );
my @ID_9090013 = qw( 保麗凈 假牙 贈 25g );
my @ID_9020001 = qw( 保麗凈 假牙 6片 );
my @ID_9090005 = qw( 保麗凈 新年 促銷 48T );
my @ID_9090003 = qw( 保麗凈 促銷裝 假牙清潔盒 24T );
my @ID_9090019 = qw( 保麗凈 假牙 清潔 6片 促銷 );
my @ID_9090021 = qw( 保麗凈 假牙 清潔 60片 贈 6片 促銷裝 );
my @ID_9090023 = qw( 保麗凈 局部 假牙 24片 贈購物袋 );
my @ID_9090201 = qw( 保麗凈 假牙 清潔片 24片 贈放大鏡 );
my @ID_9090202 = qw( 保麗凈 局部 24片 贈手電筒 );
my @ID_9020405 = qw( 保麗凈 假牙 黏合劑 60g 臺灣再包裝 );
my @ID_9020404 = qw( 保麗凈 假牙 黏合劑 40g 臺灣再包裝 );
my @ID_9020401 = qw( 保麗凈 假牙 穩(wěn)固劑 70g );
my @ID_9020102 = qw( 保麗凈 假牙 清潔片 30片 藥店專供 );
my @ID_9020102_2 = qw( 保麗凈 全 半口 30 );
my @ID_9020102_3 = qw( 保麗凈 全 半口 30 24 盒 );
my @ID_9020302 = qw( 假牙清潔片 局部 30 );
my @ID_9020101 = qw( 假牙清潔片 24 );
my @ID_9020103 = qw( 保麗凈 假牙 清潔片 60 );
my @ID_9020301 = qw( 假牙清潔片 局部 24 );
my @ID_9090205 = qw( 保麗凈 假牙 清潔片 24片 贈6片 );
my @ID_9090206 = qw( 保麗凈局部24片贈6片 );
my @ID_9090207 = qw( 保麗凈假牙清潔片60片贈24片 );
my @ID_26151 = qw( 必理通 對乙酰氨基酚片 10 );
my @ID_26151_2 = qw( 對乙酰氨基酚片 );
my @ID_44351 = qw( 腸蟲清 );
my @ID_44351_2 = qw( 阿苯達唑片 );
my @ID_10152 = qw( 布洛芬緩釋膠囊 0.3 20 );
my @ID_10152_2 = qw( 布洛芬緩釋膠囊 300 20 );
my @ID_10152_3 = qw( 芬必得 0.3 20 );
my @ID_10152_4 = qw( 芬必得 膠囊 20 );
my @ID_10152_5 = qw( 布洛芬 膠囊 20 );
my @ID_5200000 = qw( 芬必得0.3g*4T );
my @ID_1035100 = qw( 布洛芬緩釋膠囊 0.4 );
my @ID_1035100_2 = qw( 芬必得膠囊 0.4 );
my @ID_1035100_3 = qw( 布洛芬緩釋膠囊 0.4 24 );
my @ID_1035100_4 = qw( 布洛芬緩釋膠囊 400 );
my @ID_1035100_5 = qw( 芬必得 400 );
my @ID_26352 = qw( 酚咖片 20 );
my @ID_26352_1 = qw( 芬咖片 20 );
my @ID_26352_2 = qw( 酚咖片 10 2板 );
my @ID_26352_3 = qw( 酚咖片 10 2B );
my @ID_26351 = qw( 酚咖片 10 );
my @ID_10251 = qw( 布洛芬乳膏 20 );
my @ID_10251_2 = qw( 芬必得乳膏 20 );
my @ID_10251_3 = qw( 芬必得乳膏 );
my @ID_10251_4 = qw( 芬必得乳膏 );
my @ID_51002 = qw( 輔舒良 120 );
my @ID_51002_2 = qw( 丙酸氟替卡松鼻噴霧劑 120 );
my @ID_135002G = qw( 施泰福 艾麗婷 修潤沐浴油 150ml );
my @ID_135003G = qw( 施泰福 樂蒂克 果酸保濕乳液 100g );
my @ID_135004G = qw( 施泰福 愛可妮 潔膚露 100ml );
my @ID_135005G = qw( 霏絲佳修潤潔膚露100ml );
my @ID_135006G = qw( 施泰福 愛可妮 潔膚皂 100g );
my @ID_135011G = qw( 施泰福 詩蓓白柔皙防曬乳霜 SPF30/PA 60g );
my @ID_135016G = qw( 施泰福 霏絲佳 潤膚霜 75ml );
my @ID_135020G = qw( 施泰福 霏絲佳 潤膚乳液 100ml );
my @ID_135021G = qw( 霏絲佳 特護修潤霜 50ml );
my @ID_135033G = qw( 霏絲佳 特護修潤乳液 100ml );
my @ID_135034G = qw( 施泰福 霏絲佳 修潤密集滋養(yǎng)霜 50ml );
my @ID_135035G = qw( 施泰福 霏絲佳 修潤沐浴露 150ml );
my @ID_9090017 = qw( 舒適達 牙齦護理 120g 贈 速效 25g );
my @ID_9090018 = qw( 舒適達 專業(yè)修復 100g 贈 馬克杯 );
my @ID_9090016 = qw( 舒適達 速效抗敏 120g 贈 速效 25 );
my @ID_9090009 = qw( 舒適達 速效抗敏 120g 送牙刷 );
my @ID_9090011 = qw( 舒適達 美白 120g 贈牙刷 );
my @ID_9090010 = qw( 舒適達 美白 120g 贈馬克杯 );
my @ID_9090008 = qw( 舒適達 清新 120g 贈 清新 25g 促銷裝 );
my @ID_9090004 = qw( 舒適達 清新 120g 贈 速效 25g 促銷裝 );
my @ID_9090002 = qw( 舒適達 升級 全面護理 50g 特價體驗裝 );
my @ID_9010005 = qw( 舒適達 美白 120 );
my @ID_9010002 = qw( 舒適達 清新 薄荷 120 );
my @ID_9010006 = qw( 舒適達 全效護理 50g );
my @ID_9010012 = qw( 舒適達 全面護理 漱口水 500ml );
my @ID_9010013 = qw( 舒適達 全面護理 漱口水 再包裝 500ml );
my @ID_9010401 = qw( 舒適達 牙齦護理 180g );
my @ID_9010302 = qw( 舒適達 速效抗敏 180g );
my @ID_9090102 = qw( 舒適達 全面護理 120g 贈牙刷 );
my @ID_9010301 = qw( 舒適達 速效抗敏 100g );
my @ID_9010009 = qw( 舒適達 清新薄荷 25g );
my @ID_9090001 = qw( 舒適達 清新薄荷 雙支 88折優(yōu)惠裝 );
my @ID_9090103 = qw( 舒適達 牙齦護理 120g 贈牙刷 促銷裝 );
my @ID_9090104 = qw( 舒適達 牙齦護理 120克 贈全面護理 50g );
my @ID_9010701 = qw( 舒適達 微粒勁潔泡沫啫喱牙膏 100ml );
my @ID_9010017 = qw( 舒適達 全面護理 120 );
my @ID_9010018 = qw( 舒適達 速效抗敏 120 );
my @ID_9010019 = qw( 舒適達 牙齦護理 120 );
my @ID_9090105 = qw( 舒適達 專業(yè)修復 100g 贈 25 );
my @ID_9090106 = qw( 舒適達 專業(yè)修復 美白 100g 贈 25g );
my @ID_9090107 = qw( 舒適達 專業(yè)修復 100g 贈樂扣杯 );
my @ID_9090108 = qw( 舒適達 專業(yè)修復 美白 贈樂扣杯 );
my @ID_9010101 = qw( 全面護理 70 );
my @ID_9010303 = qw( 速效抗敏 70 );
my @ID_9090109 = qw( 舒適達 專業(yè)修復100克贈速效25g(OTC專供) );
my @ID_9010800 = qw( 舒適達 專業(yè)修復 100 );
my @ID_9011400 = qw( 舒適達 專業(yè)修復 美白 100 );
my @ID_9010900 = qw( 舒適達 全方位防護 100 );
my @ID_9011000 = qw( 舒適達 全方位防護 勁爽 薄荷 100 );
my @ID_9090114 = qw( 舒適達 速效抗敏 贈 50 );
my @ID_9090110 = qw( 舒適達 全面護理 贈 25g );
my @ID_9010391 = qw( 舒適達 速效抗敏 25 );
my @ID_9010990 = qw( 舒適達 全方位防護 27 );
my @ID_9010390 = qw( 舒適達 速效抗敏 25 );
my @ID_9010890 = qw( 舒適達 專業(yè)修復 27 );
my @ID_9090115 = qw( 舒適達 速效抗敏 180 贈 全面護理 50 );
my @ID_9010102 = qw( 舒適達 全面護理 180 );
my @ID_9010501 = qw( 舒適達 美白配方 180 );
my @ID_9090116 = qw( 舒適達 全面護理 120g 贈 25g );
my @ID_6100000 = qw( 通氣鼻貼 透明 );
my @ID_6100000_2 = qw( 通氣鼻帖 透明 );
my @ID_6100100 = qw( 通氣鼻貼 膚色 );
my @ID_6100100_2 = qw(通氣鼻帖 膚色 );
my @ID_6100200 = qw( 通氣鼻貼 兒童 8 );
my @ID_6100201 = qw( 通氣鼻帖 兒童 促銷裝 );
my @ID_6100400 = qw( 通氣鼻貼 薄荷 );
my @ID_7200100 = qw( 軟糖 檸檬 20 袋 );
my @ID_7200000 = qw( 軟糖 檸檬 20 );
my @ID_7200000_2 = qw( 軟糖 檸檬 40 );
my @ID_7100100 = qw( 軟糖 薄荷 20 袋 );
my @ID_7110000 = qw( 軟糖 薄荷 20 G );
my @ID_7110000_2 = qw( 軟糖 薄荷 40 );
my @ID_7300000 = qw( 軟糖 莓果 );
my @ID_7300000_2 = qw( 新康泰克 莓果 );
my @ID_7300000_3 = qw( 新康泰克 草莓 );
my @ID_7300000_4 = qw( 軟糖 草莓 );
my @ID_7100002 = qw( 喉爽 薄荷 聽裝 促銷裝 );
my @ID_7200002 = qw( 軟糖 檸檬 40G );
my @ID_7300003 = qw( 潤喉軟糖莓果口味+薄荷袋裝促銷裝 聽 袋 );
my @ID_05451 = qw( 新康泰克膠囊 10 );
my @ID_05451_2 = qw( 復方鹽酸偽麻黃 10 );
my @ID_0545102 = qw( 鹽酸偽麻黃 8 );
my @ID_0545102_2 = qw( 新康泰克 膠囊 8 );
my @ID_05252 = qw( 美撲偽麻 10 );
my @ID_05252_2 = qw( 美撲偽麻 10 200 );
my @ID_05252_3 = qw( 美撲偽麻片 10S 10盒 20條 );
my @ID_05253 = qw( 美撲偽麻 20 );
my @ID_05253_2 = qw( 美撲偽麻 10 2板 );
my @ID_6600100 = qw( 鹽酸氨溴索緩釋膠囊 10 );
my @ID_6600000 = qw( 鹽酸氨溴索緩釋膠囊 6 );
my @ID_9030201 = qw( 益周適 專業(yè)牙齦 護理牙膏 勁爽薄荷 180g );
my @ID_9030100 = qw( 益周適 專業(yè)牙齦 120g );
my @ID_9030100_2 = qw( 益周適 專業(yè)牙齦 120克 );
my @ID_9030101 = qw( 益周適 專業(yè)牙齦 護理牙膏 180g );
my @ID_9030200 = qw( 益周適 專業(yè)牙齦 護理牙膏 勁爽薄荷 120g );
my @ID_knl = qw( 康納樂 );
my @ID_knl_2 = qw( 復方曲安奈德乳膏 );
my @ID_bkl = qw( 伯克納 );
my @ID_bkl_2 = qw( 丙酸倍氯米松鼻噴霧劑 );
my @ID_hpd = qw( 賀普丁 );
my @ID_hpd_2 = qw( 拉米夫定片 );
my @ID_hwl = qw( 賀維力 );
my @ID_hwl_2 = qw( 阿德福韋酯片 );
my @ID_lms = qw( 蘭美抒 );
my @ID_lms_2 = qw( 鹽酸特比萘芬乳膏 );
my @ID_slt = qw( 賽樂特 );
my @ID_slt_2 = qw( 鹽酸帕羅西汀片 );
my @ID_twm = qw( 泰為美 );
my @ID_twm_2 = qw( 西咪替丁片 );
my @ID_wtl = qw( 萬托林 );
my @ID_wtl_2 = qw( 硫酸沙丁胺醇吸入氣霧劑 );
my @ID_smt = qw( 沙美特 );
my @ID_smt_2 = qw( 羅體卡松粉 );
my @ID_fst = qw( 輔舒酮 );
my @ID_9090209 = qw(保麗凈 30 送 6 );
my @ID_9090208 = qw(保麗凈 局部 30 送 6 );
my @ID_9090209_2 = qw(保麗凈 30 6 );
my @ID_9090208_2 = qw(保麗凈 局部 30 6 );
# 7100003、7200003 、qita_fushuliang 這個編碼不能用,為禁碼
our $a;
{
no warnings;
sub match{
given( $encode_name ) {
when( is( @ID_05451 ) ) { $a = ['05451', '盒'];continue; }
when( is( @ID_05451_2 ) ) { $a = ['05451', '盒'];continue; }
when( is( @ID_5300000 ) ) { $a = ['5300000','瓶'];continue; }
when( is( @ID_5300000_2) ) { $a = ['5300000','瓶'];continue; }
when( is( @ID_5000000 ) ) { $a = ['5000000','支'];continue; }
when( is( @ID_5000000_2) ) { $a = ['5000000','支'];continue; }
when( is( @ID_02251 ) ) { $a = ['02251', '支'];continue; }
when( is( @ID_02251_2 ) ) { $a = ['02251', '支'];continue; }
when( is( @ID_02251_3 ) ) { $a = ['02251', '支'];continue; }
when( is( @ID_02251_4 ) ) { $a = ['02251', '支'];continue; }
when( is( @ID_5100000 ) ) { $a = ['5100000','盒'];continue; }
when( is( @ID_9090012 ) ) { $a = ['9090012','盒'];continue; }
when( is( @ID_9090013 ) ) { $a = ['9090013','盒'];continue; }
when( is( @ID_9020001 ) ) { $a = ['9020001','盒'];continue; }
when( is( @ID_9090005 ) ) { $a = ['9090005','盒'];continue; }
when( is( @ID_9090003 ) ) { $a = ['9090003','盒'];continue; }
when( is( @ID_9090019 ) ) { $a = ['9090019','盒'];continue; }
when( is( @ID_9090021 ) ) { $a = ['9090021','盒'];continue; }
when( is( @ID_9090023 ) ) { $a = ['9090023','盒'];continue; }
when( is( @ID_9090201 ) ) { $a = ['9090201','盒'];continue; }
when( is( @ID_9090202 ) ) { $a = ['9090202','盒'];continue; }
when( is( @ID_9020405 ) ) { $a = ['9020405','支'];continue; }
when( is( @ID_9020404 ) ) { $a = ['9020404','支'];continue; }
when( is( @ID_9020401 ) ) { $a = ['9020401','支'];continue; }
when( is( @ID_9020101 ) ) { $a = ['9020101','盒'];continue; }
when( is( @ID_9020102 ) ) { $a = ['9020102','盒'];continue; }
when( is( @ID_9020102_2) ) { $a = ['9020102','盒'];continue; }
when( is( @ID_9020102_3) ) { $a = ['9020102','盒'];continue; }
when( is( @ID_9020103 ) ) { $a = ['9020103','盒'];continue; }
when( is( @ID_9020301 ) ) { $a = ['9020301','盒'];continue; }
when( is( @ID_9020302 ) ) { $a = ['9020302','盒'];continue; }
when( is( @ID_9090205 ) ) { $a = ['9090205','盒'];continue; }
when( is( @ID_9090206 ) ) { $a = ['9090206','盒'];continue; }
when( is( @ID_9090207 ) ) { $a = ['9090207','盒'];continue; }
when( is( @ID_26151 ) ) { $a = ['26151', '盒'];continue; }
when( is( @ID_26151_2 ) ) { $a = ['26151', '盒'];continue; }
when( is( @ID_44351 ) ) { $a = ['44351', '盒'];continue; }
when( is( @ID_44351_2 ) ) { $a = ['44351', '盒'];continue; }
when( is( @ID_10152 ) ) { $a = ['10152', '盒'];continue; }
when( is( @ID_10152_2 ) ) { $a = ['10152', '盒'];continue; }
when( is( @ID_10152_3 ) ) { $a = ['10152', '盒'];continue; }
when( is( @ID_10152_4 ) ) { $a = ['10152', '盒'];continue; }
when( is( @ID_10152_5 ) ) { $a = ['10152', '盒'];continue; }
when( is( @ID_5200000 ) ) { $a = ['5200000','盒'];continue; }
when( is( @ID_1035100 ) ) { $a = ['1035100','盒'];continue; }
when( is( @ID_1035100_2) ) { $a = ['1035100','盒'];continue; }
when( is( @ID_1035100_3) ) { $a = ['1035100','盒'];continue; }
when( is( @ID_1035100_4) ) { $a = ['1035100','盒'];continue; }
when( is( @ID_1035100_5) ) { $a = ['1035100','盒'];continue; }
when( is( @ID_26351 ) ) { $a = ['26351', '盒'];continue; }
when( is( @ID_26352 ) ) { $a = ['26352', '盒'];continue; }
when( is( @ID_26352_1 ) ) { $a = ['26352', '盒'];continue; }
when( is( @ID_26352_2 ) ) { $a = ['26352', '盒'];continue; }
when( is( @ID_26352_3 ) ) { $a = ['26352', '盒'];continue; }
when( is( @ID_10251 ) ) { $a = ['10251', '支'];continue; }
when( is( @ID_10251_2 ) ) { $a = ['10251', '支'];continue; }
when( is( @ID_10251_3 ) ) { $a = ['10251', '支'];continue; }
when( is( @ID_10251_4 ) ) { $a = ['10251', '支'];continue; }
when( is( @ID_51002 ) ) { $a = ['51002', '支'];continue; }
when( is( @ID_51002_2 ) ) { $a = ['51002', '支'];continue; }
when( is( @ID_135002G ) ) { $a = ['135002G','支'];continue; }
when( is( @ID_135003G ) ) { $a = ['135003G','支'];continue; }
when( is( @ID_135004G ) ) { $a = ['135004G','支'];continue; }
when( is( @ID_135005G ) ) { $a = ['135005G','支'];continue; }
when( is( @ID_135006G ) ) { $a = ['135006G','支'];continue; }
when( is( @ID_135011G ) ) { $a = ['135011G','支'];continue; }
when( is( @ID_135016G ) ) { $a = ['135016G','支'];continue; }
when( is( @ID_135020G ) ) { $a = ['135020G','支'];continue; }
when( is( @ID_135021G ) ) { $a = ['135021G','支'];continue; }
when( is( @ID_135033G ) ) { $a = ['135033G','支'];continue; }
when( is( @ID_135034G ) ) { $a = ['135034G','支'];continue; }
when( is( @ID_135035G ) ) { $a = ['135035G','支'];continue; }
when( is( @ID_9090017 ) ) { $a = ['9090017','支'];continue; }
when( is( @ID_9090018 ) ) { $a = ['9090018','支'];continue; }
when( is( @ID_9090016 ) ) { $a = ['9090016','支'];continue; }
when( is( @ID_9090009 ) ) { $a = ['9090009','支'];continue; }
when( is( @ID_9090011 ) ) { $a = ['9090011','支'];continue; }
when( is( @ID_9090010 ) ) { $a = ['9090010','支'];continue; }
when( is( @ID_9090008 ) ) { $a = ['9090008','支'];continue; }
when( is( @ID_9090004 ) ) { $a = ['9090004','支'];continue; }
when( is( @ID_9090002 ) ) { $a = ['9090002','支'];continue; }
when( is( @ID_9010005 ) ) { $a = ['9010005','支'];continue; }
when( is( @ID_9010002 ) ) { $a = ['9010002','支'];continue; }
when( is( @ID_9010006 ) ) { $a = ['9010006','支'];continue; }
when( is( @ID_9010012 ) ) { $a = ['9010012','支'];continue; }
when( is( @ID_9010013 ) ) { $a = ['9010013','支'];continue; }
when( is( @ID_9010401 ) ) { $a = ['9010401','支'];continue; }
when( is( @ID_9010302 ) ) { $a = ['9010302','支'];continue; }
when( is( @ID_9090102 ) ) { $a = ['9090102','盒'];continue; }
when( is( @ID_9010301 ) ) { $a = ['9010301','支'];continue; }
when( is( @ID_9010009 ) ) { $a = ['9010009','支'];continue; }
when( is( @ID_9090001 ) ) { $a = ['9090001','支'];continue; }
when( is( @ID_9090103 ) ) { $a = ['9090103','支'];continue; }
when( is( @ID_9090104 ) ) { $a = ['9090104','支'];continue; }
when( is( @ID_9010701 ) ) { $a = ['9010701','支'];continue; }
when( is( @ID_9010017 ) ) { $a = ['9010017','支'];continue; }
when( is( @ID_9010018 ) ) { $a = ['9010018','支'];continue; }
when( is( @ID_9010019 ) ) { $a = ['9010019','支'];continue; }
when( is( @ID_9090105 ) ) { $a = ['9090105','支'];continue; }
when( is( @ID_9090106 ) ) { $a = ['9090106','支'];continue; }
when( is( @ID_9090107 ) ) { $a = ['9090107','支'];continue; }
when( is( @ID_9090108 ) ) { $a = ['9090108','支'];continue; }
when( is( @ID_9010101 ) ) { $a = ['9010101','支'];continue; }
when( is( @ID_9010303 ) ) { $a = ['9010303','支'];continue; }
when( is( @ID_9090109 ) ) { $a = ['9090109','支'];continue; }
when( is( @ID_9010800 ) ) { $a = ['9010800','支'];continue; }
when( is( @ID_9011400 ) ) { $a = ['9011400','支'];continue; }
when( is( @ID_9010900 ) ) { $a = ['9010900','支'];continue; }
when( is( @ID_9011000 ) ) { $a = ['9011000','支'];continue; }
when( is( @ID_9090114 ) ) { $a = ['9090114','支'];continue; }
when( is( @ID_9090110 ) ) { $a = ['9090110','支'];continue; }
when( is( @ID_9010391 ) ) { $a = ['9010391','支'];continue; }
when( is( @ID_9010990 ) ) { $a = ['9010990','支'];continue; }
when( is( @ID_9010390 ) ) { $a = ['9010390','支'];continue; }
when( is( @ID_9010890 ) ) { $a = ['9010890','支'];continue; }
when( is( @ID_9090115 ) ) { $a = ['9090115','支'];continue; }
when( is( @ID_9010102 ) ) { $a = ['9010102','支'];continue; }
when( is( @ID_9010501 ) ) { $a = ['9010501','支'];continue; }
when( is( @ID_9090116 ) ) { $a = ['9090116','支'];continue; }
when( is( @ID_6100000 ) ) { $a = ['6100000','盒'];continue; }
when( is( @ID_6100000_2) ) { $a = ['6100000','盒'];continue; }
when( is( @ID_6100100 ) ) { $a = ['6100100','盒'];continue; }
when( is( @ID_6100100_2) ) { $a = ['6100100','盒'];continue; }
when( is( @ID_6100200 ) ) { $a = ['6100200','盒'];continue; }
when( is( @ID_6100201 ) ) { $a = ['6100201','盒'];continue; }
when( is( @ID_6100400 ) ) { $a = ['6100400','盒'];continue; }
when( is( @ID_7200100 ) ) { $a = ['7200100','袋'];continue; }
when( is( @ID_7200000 ) ) { $a = ['7200000','瓶'];continue; }
when( is( @ID_7200000_2) ) { $a = ['7200000','瓶'];continue; }
when( is( @ID_7100100 ) ) { $a = ['7100100','袋'];continue; }
when( is( @ID_7110000 ) ) { $a = ['7110000','瓶'];continue; }
when( is( @ID_7110000_2) ) { $a = ['7110000','瓶'];continue; }
when( is( @ID_7300000 ) ) { $a = ['7300000','瓶'];continue; }
when( is( @ID_7300000_2) ) { $a = ['7300000','瓶'];continue; }
when( is( @ID_7300000_3) ) { $a = ['7300000','瓶'];continue; }
when( is( @ID_7300000_4) ) { $a = ['7300000','瓶'];continue; }
when( is( @ID_7100002 ) ) { $a = ['7100002','瓶'];continue; }
when( is( @ID_7200002 ) ) { $a = ['7200002','瓶'];continue; }
when( is( @ID_7300003 ) ) { $a = ['7300003','瓶'];continue; }
when( is( @ID_0545102 ) ) { $a = ['0545102','盒'];continue; }
when( is( @ID_0545102_2) ) { $a = ['0545102','盒'];continue; }
when( is( @ID_05252 ) ) { $a = ['05252', '盒'];continue; }
when( is( @ID_05253 ) ) { $a = ['05253', '盒'];continue; }
when( is( @ID_05252_2 ) ) { $a = ['05252', '盒'];continue; } # 更精確的匹配位置要靠后
when( is( @ID_05253_2 ) ) { $a = ['05253', '盒'];continue; }
when( is( @ID_05252_3 ) ) { $a = ['05252', '盒'];continue; }
when( is( @ID_6600100 ) ) { $a = ['6600100','盒'];continue; }
when( is( @ID_6600000 ) ) { $a = ['6600000','盒'];continue; }
when( is( @ID_9030201 ) ) { $a = ['9030201','支'];continue; }
when( is( @ID_9030100 ) ) { $a = ['9030100','支'];continue; }
when( is( @ID_9030100_2) ) { $a = ['9030100','支'];continue; }
when( is( @ID_9030101 ) ) { $a = ['9030101','支'];continue; }
when( is( @ID_9030200 ) ) { $a = ['9030200','支'];continue; }
when( is( @ID_knl ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_knl_2 ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_bkl ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_bkl_2 ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_hpd ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_hpd_2 ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_hwl ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_hwl_2 ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_lms ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_lms_2 ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_slt ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_slt_2 ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_twm ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_twm_2 ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_wtl ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_wtl_2 ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_smt ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_smt_2 ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_fst ) ) { $a = ['qita', '盒'];continue; }
when( is( @ID_9090209 ) ) { $a = ['9090209','盒'];continue; }
when( is( @ID_9090208 ) ) { $a = ['9090208','盒'];continue; }
when( is( @ID_9090209_2) ) { $a = ['9090209','盒'];continue; }
when( is( @ID_9090208_2) ) { $a = ['9090208','盒'];continue; }
}
}
}
my @headers=(
['ID', '組織名稱', '經(jīng)銷商編碼', '經(jīng)銷商名稱', '客戶端編碼', '客戶端名稱', '經(jīng)銷商產(chǎn)品編碼', '經(jīng)銷商產(chǎn)品條碼', '經(jīng)銷商產(chǎn)品名稱', '經(jīng)銷商產(chǎn)品單位', '產(chǎn)品標準編碼', '產(chǎn)品標準名稱', 'UPC', '產(chǎn)品類型', '匹配后單位', '創(chuàng)建日期', '匹配日期', '最近變更日期']
);
my @encoded_headers;
foreach (@{$headers[0]}) {
push @{$encoded_headers[0]},decode("gb2312",$_);
};
my $head_format = $workbook->add_format( align => 'center',font => 'Arial', size => 8,bg_color => '#D3D3D3'); # lightgray
my $format1 = $workbook->add_format( align => 'left', font => 'Arial', size => 8);
my $format2 = $workbook->add_format( align => 'left', font => 'Arial', size => 8,num_format => '@');
my @columns;
foreach my $old_sheet( @{$excel -> {Worksheet}}[0] ) { # 只讀取第一張工作表,直鏈安裝
my @columns;
my $new_worksheet = $workbook->add_worksheet(H($old_sheet->{Name})); # 將原來的工作表名添加到新的 Excel
$new_worksheet->keep_leading_zeros(); # 保留前導0
$new_worksheet->write_col( 'A1', \@encoded_headers,$head_format); # 寫入表頭
$old_sheet -> {MaxCol} ||= $old_sheet -> {MinCol}; #|| 邏輯或,返回計算結(jié)果先為真的值,由左到右計算
# 讀取原 Excel,然后寫入 新 Excel
foreach my $col (0..16) {
$old_sheet -> {MaxRow} ||= $old_sheet -> {MinRow};
foreach my $row ($old_sheet -> {MinRow} .. $old_sheet -> {MaxRow}) {
push @{$columns[$col]},H($old_sheet -> {Cells} [$row] [$col]->{Val});# 提取固定的幾列
}
# shift @{$columns[$col]};
}
$new_worksheet->write_col( 'A2', \@{$columns[0]},$format2); # @columns 對應產(chǎn)品匹配維護.xlsx中的列
$new_worksheet->write_col( 'E2', \@{$columns[5]},$format1);
$new_worksheet->write_col( 'G2', \@{$columns[6]},$format1);
$new_worksheet->write_col( 'I2', \@{$columns[8]},$format1);
$new_worksheet->write_col( 'J2', \@{$columns[16]},$format1);
# print Dumper(\@{$columns[8]});
for my $name ( @{$columns[8]} ) {
chomp $name;
$encode_name = encode("gb2312",$name); # 編碼后才能讓匹配識別
{
no warnings;
&match;
$new_worksheet->write( 'K'.$n,$a->[0],$format2);
$new_worksheet->write( 'O'.$n++,decode("gb2312",$a->[1]),$format2);
undef $a;
}
}
}
__DATA__
產(chǎn)品代碼 產(chǎn)品名稱
5300000 百多邦噴霧
5000000 百多邦10g
02251 百多邦5g
5100000 百多邦皮炎濕疹乳膏15g
9090012 保麗凈假牙清潔片局部贈清潔刷 24T
9090013 保麗凈假牙清潔片贈速效25g 24T+25g
9020001 保麗凈假牙清潔片6片體驗裝
9090005 保麗凈新年促銷裝48T
9090003 保麗凈買贈促銷裝 - 贈假牙清潔盒24T
9090019 保麗凈假牙清潔6片促銷裝
9090021 保麗凈假牙清潔60片贈6片促銷裝
9090023 保麗凈局部假牙24片贈購物袋
9090201 保麗凈假牙清潔片24片贈放大鏡
9090202 保麗凈局部24片贈手電筒
9020405 保麗凈假牙黏合劑60g臺灣再包裝
9020404 保麗凈假牙黏合劑40g臺灣再包裝
9020401 保麗凈假牙穩(wěn)固劑70g
9020102 保麗凈假牙清潔片30片(藥店專供)
9020302 保麗凈假牙清潔片局部假牙專用30片(藥店專供)
9020101 保麗凈假牙清潔片24片
9020103 保麗凈假牙清潔片60片
9020301 保麗凈假牙清潔片局部假牙專用24片
9090205 保麗凈假牙清潔片24片贈6片
9090206 保麗凈局部24片贈6片
9090207 保麗凈假牙清潔片60片贈24片
26151 必理通0.5gx10T
44351 腸蟲清0.2gx10T
10152 芬必得0.3gx20T
5200000 芬必得0.3g*4T
1035100 芬必得布洛芬緩釋膠囊 400mg
26352 芬必得 酚咖片20T
26351 芬必得 酚咖片10T
10251 芬必得膏
51002 輔舒良
135002G 施泰福艾麗婷修潤沐浴油150ml
135003G 施泰福樂蒂克果酸保濕乳液100g
135004G 施泰福愛可妮潔膚露100ml
135005G 霏絲佳修潤潔膚露100ml
135006G 施泰福愛可妮潔膚皂100g
135011G 施泰福詩蓓白柔皙防曬乳霜SPF30/PA++60g
135016G 施泰福霏絲佳潤膚霜75ml
135020G 施泰福霏絲佳潤膚乳液100ml
135021G 霏絲佳特護修潤霜50ml
135033G 霏絲佳特護修潤乳液100ml
135034G 施泰福霏絲佳修潤密集滋養(yǎng)霜50ml
135035G 施泰福霏絲佳修潤沐浴露 150ml
9090017 舒適達牙齦護理120g贈速效25g促銷裝
9090018 舒適達專業(yè)修復100g贈馬克杯
9090016 舒適達速效抗敏120g贈速效25
9090009 舒適達速效抗敏120g送牙刷
9090011 舒適達美白120g贈牙刷
9090010 舒適達美白120g贈馬克杯
9090008 舒適達清新120g贈清新25g促銷裝
9090004 舒適達清新120g贈速效25g促銷裝
9090002 舒適達升級全面護理50g特價體驗裝
9010005 舒適達美白120g
9010002 舒適達升級清新薄荷120g
9010006 舒適達全效護理50g
9010012 舒適達全面護理漱口水 500ml
9010013 舒適達全面護理漱口水(再包裝)500ml
9010401 舒適達牙齦護理180g
9010302 舒適達速效抗敏180g
9090102 舒適達全面護理120g贈牙刷
9010301 舒適達速效抗敏100g
9010009 舒適達-清新薄荷25g
9090001 舒適達清新薄荷雙支88折優(yōu)惠裝
9090103 舒適達牙齦護理120g贈牙刷促銷裝
9090104 舒適達牙齦護理120克贈全面護理50g
9010701 舒適達微粒勁潔泡沫啫喱牙膏(再包裝)100ml
9010017 舒適達-升級全面護理(國產(chǎn))120g
9010018 舒適達-速效抗敏(國產(chǎn))120g
9010019 舒適達-牙齦護理(國產(chǎn))120g
9090105 舒適達專業(yè)修復100g贈速效25
9090106 舒適達專業(yè)修復美白100g贈速效25g
9090107 舒適達專業(yè)修復100g贈樂扣杯
9090108 舒適達專業(yè)修復美白贈樂扣杯
9010101 全面護理70g
9010303 速效抗敏70g
9090109 舒適達專業(yè)修復100克贈速效25g(OTC專供)
9010800 舒適達專業(yè)修復100克
9011400 舒適達專業(yè)修復美白100克
9010900 舒適達全方位防護100克
9011000 舒適達全方位防護勁爽薄荷100克
9090114 舒適達速效抗敏贈全面50克
9090110 舒適達全面護理贈速效25g
9010391 舒適達-速效抗敏25gDDT包裝(國產(chǎn))
9010990 舒適達-全方位防護27g(國產(chǎn))
9010390 舒適達-速效抗敏25g(國產(chǎn))
9010890 舒適達-專業(yè)修復27g(國產(chǎn))
9090115 舒適達速效抗敏180克贈全面護理50克
9010102 舒適達全面護理180克
9010501 舒適達美白配方180克
9090116 舒適達全面護理120g贈速效抗敏25g
6100000 新康泰克通氣鼻貼透明型(標準)
6100100 新康泰克通氣鼻貼膚色型(標準)10片
6100200 新康泰克通氣鼻貼兒童型 8片
6100201 新康泰克通氣鼻帖兒童型(促銷裝)
6100400 新康泰克通氣鼻貼薄荷型
7200100 新康泰克喉爽草本潤喉軟糖-檸檬口味20g袋裝
7200000 新康泰克喉爽草本潤喉軟糖-檸檬口味20粒
7100100 新康泰克喉爽草本潤喉軟糖-薄荷口味20g袋裝
7110000 新康泰克喉爽草本潤喉軟糖-薄荷口味20粒(國產(chǎn))
7300000 新康泰克喉爽_草本潤喉軟糖40g_莓果口味
7100002 新康泰克喉爽薄荷聽裝促銷裝
7200002 新康泰克喉爽檸檬聽裝促銷裝
7200003 新康泰克潤喉軟糖檸檬口味促銷裝(聽+袋)
7100003 新康泰克潤喉軟糖薄荷口味促銷裝(聽+袋)
7300003 新康泰克潤喉軟糖莓果口味+薄荷袋裝促銷裝(聽+袋)
05451 新康泰克10c
0545102 新康泰克感冒膠囊8粒
05252 新康泰克重感裝美撲偽麻10T
05253 新康泰克重感裝美撲偽麻20T
6600100 新康泰克鹽酸氨溴索緩釋膠囊10粒
6600000 新康泰克鹽酸氨溴索緩釋膠囊6粒
9030201 益周適專業(yè)牙齦護理牙膏勁爽薄荷180g
9030100 益周適專業(yè)牙齦護理牙膏120g
9030101 益周適專業(yè)牙齦護理牙膏180g
9030200 益周適專業(yè)牙齦護理牙膏勁爽薄荷120g
產(chǎn)品匹配
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。
- 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事?!?“怎么了?”我有些...
- 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上,一...
- 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起,我...
- 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜,卻給世界環(huán)境...
- 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背。 一陣腳步聲響...
推薦閱讀更多精彩內(nèi)容
- 本文譯自:You want more than product/market fit,原作者保留所有版權(quán) 當你在設(shè)...
- 很多人覺得“框架+清單式思維”很重要,無論是在日常生活中還是在處理工作事項上。 例如,我們在寫作的時候會運用到它。...
- 公司搬了,搬到了一個互聯(lián)網(wǎng)公司聚集地。成都60%的互聯(lián)網(wǎng)和通信方面的公司都在這里。這里有高大上的寫字樓,也有接地氣...