サクラエディタ・VXEditorでjgawkを使う(1)
<kenall.csv>
日本郵便トップ > 郵便番号検索 > 郵便番号データダウンロード
郵便番号データダウンロード
http://www.post.japanpost.jp/zipcode/download.html
読み仮名データの促音・拗音を小書きで表記しないもの
http://www.post.japanpost.jp/zipcode/dl/oogaki.html
全国一括(1,738,525Byte) ken_all.lzh
まずは、jgawkを試験。
<a001.awk>
BEGIN{FS=",";ixA=1;ixB=1;ixC=1;
}
{
func_join();
a001=length(NR);
recA[ixA]=substr("0000000" NR,a001+1,7) "\t" $3 "\t" $7 "\t" $8 "\t" $9 "\t" $4 "\t" $5 "\t" $6 "\n";
ixA++;
}
END{
func_STDOUT();
}
function func_join(){
if(ixA>100){
if(ixB>100){
recC[ixC] = recB[1] recB[2] recB[3] recB[4] recB[5] recB[6] recB[7] recB[8] recB[9] recB[10] recB[11] recB[12] recB[13] recB[14] recB[15] recB[16] recB[17] recB[18] recB[19] recB[20] recB[21] recB[22] recB[23] recB[24] recB[25] recB[26] recB[27] recB[28] recB[29] recB[30] recB[31] recB[32] recB[33] recB[34] recB[35] recB[36] recB[37] recB[38] recB[39] recB[40] recB[41] recB[42] recB[43] recB[44] recB[45] recB[46] recB[47] recB[48] recB[49] recB[50] recB[51] recB[52] recB[53] recB[54] recB[55] recB[56] recB[57] recB[58] recB[59] recB[60] recB[61] recB[62] recB[63] recB[64] recB[65] recB[66] recB[67] recB[68] recB[69] recB[70] recB[71] recB[72] recB[73] recB[74] recB[75] recB[76] recB[77] recB[78] recB[79] recB[80] recB[81] recB[82] recB[83] recB[84] recB[85] recB[86] recB[87] recB[88] recB[89] recB[90] recB[91] recB[92] recB[93] recB[94] recB[95] recB[96] recB[97] recB[98] recB[99] recB[100];
for(ixB=1;ixB<101;ixB++){
recB[ixB]="";
}
ixB=1;
ixC++;
}
recB[ixB]= recA[1] recA[2] recA[3] recA[4] recA[5] recA[6] recA[7] recA[8] recA[9] recA[10] recA[11] recA[12] recA[13] recA[14] recA[15] recA[16] recA[17] recA[18] recA[19] recA[20] recA[21] recA[22] recA[23] recA[24] recA[25] recA[26] recA[27] recA[28] recA[29] recA[30] recA[31] recA[32] recA[33] recA[34] recA[35] recA[36] recA[37] recA[38] recA[39] recA[40] recA[41] recA[42] recA[43] recA[44] recA[45] recA[46] recA[47] recA[48] recA[49] recA[50] recA[51] recA[52] recA[53] recA[54] recA[55] recA[56] recA[57] recA[58] recA[59] recA[60] recA[61] recA[62] recA[63] recA[64] recA[65] recA[66] recA[67] recA[68] recA[69] recA[70] recA[71] recA[72] recA[73] recA[74] recA[75] recA[76] recA[77] recA[78] recA[79] recA[80] recA[81] recA[82] recA[83] recA[84] recA[85] recA[86] recA[87] recA[88] recA[89] recA[90] recA[91] recA[92] recA[93] recA[94] recA[95] recA[96] recA[97] recA[98] recA[99] recA[100];
for(ixA=1;ixA<101;ixA++){
recA[ixA] =""
}
ixA=1;
ixB++;
}
}
function func_STDOUT(){
if(ixB>100){
recC[ixC] = recB[1] recB[2] recB[3] recB[4] recB[5] recB[6] recB[7] recB[8] recB[9] recB[10] recB[11] recB[12] recB[13] recB[14] recB[15] recB[16] recB[17] recB[18] recB[19] recB[20] recB[21] recB[22] recB[23] recB[24] recB[25] recB[26] recB[27] recB[28] recB[29] recB[30] recB[31] recB[32] recB[33] recB[34] recB[35] recB[36] recB[37] recB[38] recB[39] recB[40] recB[41] recB[42] recB[43] recB[44] recB[45] recB[46] recB[47] recB[48] recB[49] recB[50] recB[51] recB[52] recB[53] recB[54] recB[55] recB[56] recB[57] recB[58] recB[59] recB[60] recB[61] recB[62] recB[63] recB[64] recB[65] recB[66] recB[67] recB[68] recB[69] recB[70] recB[71] recB[72] recB[73] recB[74] recB[75] recB[76] recB[77] recB[78] recB[79] recB[80] recB[81] recB[82] recB[83] recB[84] recB[85] recB[86] recB[87] recB[88] recB[89] recB[90] recB[91] recB[92] recB[93] recB[94] recB[95] recB[96] recB[97] recB[98] recB[99] recB[100];
for(ixB=1;ixB<101;ixB++){
recB[ixB]="";
}
ixB=1;
ixC++;
}
if(NR<101){
print recA[1] recA[2] recA[3] recA[4] recA[5] recA[6] recA[7] recA[8] recA[9] recA[10] recA[11] recA[12] recA[13] recA[14] recA[15] recA[16] recA[17] recA[18] recA[19] recA[20] recA[21] recA[22] recA[23] recA[24] recA[25] recA[26] recA[27] recA[28] recA[29] recA[30] recA[31] recA[32] recA[33] recA[34] recA[35] recA[36] recA[37] recA[38] recA[39] recA[40] recA[41] recA[42] recA[43] recA[44] recA[45] recA[46] recA[47] recA[48] recA[49] recA[50] recA[51] recA[52] recA[53] recA[54] recA[55] recA[56] recA[57] recA[58] recA[59] recA[60] recA[61] recA[62] recA[63] recA[64] recA[65] recA[66] recA[67] recA[68] recA[69] recA[70] recA[71] recA[72] recA[73] recA[74] recA[75] recA[76] recA[77] recA[78] recA[79] recA[80] recA[81] recA[82] recA[83] recA[84] recA[85] recA[86] recA[87] recA[88] recA[89] recA[90] recA[91] recA[92] recA[93] recA[94] recA[95] recA[96] recA[97] recA[98] recA[99] recA[100];
}
if(NR>100&&NR<10001){
recB[ixB] = recA[1] recA[2] recA[3] recA[4] recA[5] recA[6] recA[7] recA[8] recA[9] recA[10] recA[11] recA[12] recA[13] recA[14] recA[15] recA[16] recA[17] recA[18] recA[19] recA[20] recA[21] recA[22] recA[23] recA[24] recA[25] recA[26] recA[27] recA[28] recA[29] recA[30] recA[31] recA[32] recA[33] recA[34] recA[35] recA[36] recA[37] recA[38] recA[39] recA[40] recA[41] recA[42] recA[43] recA[44] recA[45] recA[46] recA[47] recA[48] recA[49] recA[50] recA[51] recA[52] recA[53] recA[54] recA[55] recA[56] recA[57] recA[58] recA[59] recA[60] recA[61] recA[62] recA[63] recA[64] recA[65] recA[66] recA[67] recA[68] recA[69] recA[70] recA[71] recA[72] recA[73] recA[74] recA[75] recA[76] recA[77] recA[78] recA[79] recA[80] recA[81] recA[82] recA[83] recA[84] recA[85] recA[86] recA[87] recA[88] recA[89] recA[90] recA[91] recA[92] recA[93] recA[94] recA[95] recA[96] recA[97] recA[98] recA[99] recA[100];
print recB[1] recB[2] recB[3] recB[4] recB[5] recB[6] recB[7] recB[8] recB[9] recB[10] recB[11] recB[12] recB[13] recB[14] recB[15] recB[16] recB[17] recB[18] recB[19] recB[20] recB[21] recB[22] recB[23] recB[24] recB[25] recB[26] recB[27] recB[28] recB[29] recB[30] recB[31] recB[32] recB[33] recB[34] recB[35] recB[36] recB[37] recB[38] recB[39] recB[40] recB[41] recB[42] recB[43] recB[44] recB[45] recB[46] recB[47] recB[48] recB[49] recB[50] recB[51] recB[52] recB[53] recB[54] recB[55] recB[56] recB[57] recB[58] recB[59] recB[60] recB[61] recB[62] recB[63] recB[64] recB[65] recB[66] recB[67] recB[68] recB[69] recB[70] recB[71] recB[72] recB[73] recB[74] recB[75] recB[76] recB[77] recB[78] recB[79] recB[80] recB[81] recB[82] recB[83] recB[84] recB[85] recB[86] recB[87] recB[88] recB[89] recB[90] recB[91] recB[92] recB[93] recB[94] recB[95] recB[96] recB[97] recB[98] recB[99] recB[100];
}
if(NR>10000){
recB[ixB] = recA[1] recA[2] recA[3] recA[4] recA[5] recA[6] recA[7] recA[8] recA[9] recA[10] recA[11] recA[12] recA[13] recA[14] recA[15] recA[16] recA[17] recA[18] recA[19] recA[20] recA[21] recA[22] recA[23] recA[24] recA[25] recA[26] recA[27] recA[28] recA[29] recA[30] recA[31] recA[32] recA[33] recA[34] recA[35] recA[36] recA[37] recA[38] recA[39] recA[40] recA[41] recA[42] recA[43] recA[44] recA[45] recA[46] recA[47] recA[48] recA[49] recA[50] recA[51] recA[52] recA[53] recA[54] recA[55] recA[56] recA[57] recA[58] recA[59] recA[60] recA[61] recA[62] recA[63] recA[64] recA[65] recA[66] recA[67] recA[68] recA[69] recA[70] recA[71] recA[72] recA[73] recA[74] recA[75] recA[76] recA[77] recA[78] recA[79] recA[80] recA[81] recA[82] recA[83] recA[84] recA[85] recA[86] recA[87] recA[88] recA[89] recA[90] recA[91] recA[92] recA[93] recA[94] recA[95] recA[96] recA[97] recA[98] recA[99] recA[100];
recC[ixC]= recB[1] recB[2] recB[3] recB[4] recB[5] recB[6] recB[7] recB[8] recB[9] recB[10] recB[11] recB[12] recB[13] recB[14] recB[15] recB[16] recB[17] recB[18] recB[19] recB[20] recB[21] recB[22] recB[23] recB[24] recB[25] recB[26] recB[27] recB[28] recB[29] recB[30] recB[31] recB[32] recB[33] recB[34] recB[35] recB[36] recB[37] recB[38] recB[39] recB[40] recB[41] recB[42] recB[43] recB[44] recB[45] recB[46] recB[47] recB[48] recB[49] recB[50] recB[51] recB[52] recB[53] recB[54] recB[55] recB[56] recB[57] recB[58] recB[59] recB[60] recB[61] recB[62] recB[63] recB[64] recB[65] recB[66] recB[67] recB[68] recB[69] recB[70] recB[71] recB[72] recB[73] recB[74] recB[75] recB[76] recB[77] recB[78] recB[79] recB[80] recB[81] recB[82] recB[83] recB[84] recB[85] recB[86] recB[87] recB[88] recB[89] recB[90] recB[91] recB[92] recB[93] recB[94] recB[95] recB[96] recB[97] recB[98] recB[99] recB[100];
print recC[1] recC[2] recC[3] recC[4] recC[5] recC[6] recC[7] recC[8] recC[9] recC[10] recC[11] recC[12] recC[13] recC[14] recC[15] recC[16] recC[17] recC[18] recC[19] recC[20] recC[21] recC[22] recC[23] recC[24] recC[25] recC[26] recC[27] recC[28] recC[29] recC[30] recC[31] recC[32] recC[33] recC[34] recC[35] recC[36] recC[37] recC[38] recC[39] recC[40] recC[41] recC[42] recC[43] recC[44] recC[45] recC[46] recC[47] recC[48] recC[49] recC[50] recC[51] recC[52] recC[53] recC[54] recC[55] recC[56] recC[57] recC[58] recC[59] recC[60] recC[61] recC[62] recC[63] recC[64] recC[65] recC[66] recC[67] recC[68] recC[69] recC[70] recC[71] recC[72] recC[73] recC[74] recC[75] recC[76] recC[77] recC[78] recC[79] recC[80] recC[81] recC[82] recC[83] recC[84] recC[85] recC[86] recC[87] recC[88] recC[89] recC[90] recC[91] recC[92] recC[93] recC[94] recC[95] recC[96] recC[97] recC[98] recC[99] recC[100];
}
}