This commit is contained in:
512song@sina.com committed 2022-10-11 19:37:45 +08:00
1 parent 417dc99d0c
commit e0c8aae7fd
1 file changed
+9 -7
+9 -7
View File
@@ -344,20 +344,21 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 222, "execution_count": 6,
"id": "c1a5aaef-70be-4fd2-9384-983aeb59f491", "id": "c1a5aaef-70be-4fd2-9384-983aeb59f491",
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2022-10-10T09:17:15.717303Z", "iopub.execute_input": "2022-10-11T06:47:28.920135Z",
"iopub.status.busy": "2022-10-10T09:17:15.716746Z", "iopub.status.busy": "2022-10-11T06:47:28.919559Z",
"iopub.status.idle": "2022-10-10T09:17:15.876065Z", "iopub.status.idle": "2022-10-11T06:47:29.076584Z",
"shell.execute_reply": "2022-10-10T09:17:15.875047Z", "shell.execute_reply": "2022-10-11T06:47:29.075429Z",
"shell.execute_reply.started": "2022-10-10T09:17:15.717217Z" "shell.execute_reply.started": "2022-10-11T06:47:28.920087Z"
}, },
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"import openpyxl\n",
"import json\n", "import json\n",
"import os\n", "import os\n",
"import glob\n", "import glob\n",
@@ -378,12 +379,13 @@
"for fn in fl:\n", "for fn in fl:\n",
" with open(fn,'r',newline='',encoding='gb18030') as csv_file:\n", " with open(fn,'r',newline='',encoding='gb18030') as csv_file:\n",
" fl1 = csv.reader(csv_file,delimiter=',')\n", " fl1 = csv.reader(csv_file,delimiter=',')\n",
" group = re.findall(r'百日筑基-(.+)》',fn)[0]\n",
" header = next(fl1)\n", " header = next(fl1)\n",
" for line in fl1: \n", " for line in fl1: \n",
" id = line[0]\n", " id = line[0]\n",
" num = line[10]\n", " num = line[10]\n",
" #print(id,num)\n", " #print(id,num)\n",
" if id in dict2.keys():\n", " if id in dict2.keys() and dict2[id][4] == group:\n",
" dict3.setdefault(id,{})\n", " dict3.setdefault(id,{})\n",
" dict3[id]['name'] = dict2[id][0]\n", " dict3[id]['name'] = dict2[id][0]\n",
" dict3[id]['phone'] = dict2[id][2]\n", " dict3[id]['phone'] = dict2[id][2]\n",