本文主要是介绍【python】批量导出IEEE的文献信息为段落文本,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
问题背景:想了解一个领域最近在做些什么,要做一个全面的survey,但是从IEEE导出的.csv文件不是那么方便看。
为了get重要信息(文章名、刊源、摘要),想把这些信息整合到一个方便阅览的文件(.tex)上。
由于相关文献太多,手动操作浪费时间也不是那么实际。
已有从IEEE导出的搜索结果,一个.csv文件。
问题描述:将.csv文件中所关注的信息(我的需求是文章名、刊源、摘要),按照段落格式排列输出到一个.txt文件上
脚本:
# -*- coding: cp936 -*-
#Description: export .txt (title+publication+abstract) from .csv file (full info.)import os
import csvdef col_selector(table,column_key):return [row[column_key] for row in table]path = '.'
file = 'export2021.04.14-02.57.16.csv'
file_path=os.path.join(path,file)
print file_path
with open(file_path, 'rb') as f:reader = csv.reader(f, delimiter=',')whole_table = [row for row in reader]table = whole_table[176:201] # 这里可以修改需要导出的行数title_col = col_selector(table, 0) # 文章名的列publication_col = col_selector(table, 3) # 刊源的列abstract_col = col_selector(table, 10)# 摘要的列out_path=os.path.join(path, file.split('.')[0]+'_out.txt')
file_write_obj = open(out_path, 'w')
for i in range(0, len(title_col)):file_write_obj.writelines('\subsection{['+str(publication_col[i])+'] '+ str(title_col[i])+'}') # 这里是为了方便在latex里新建section,格式可以自行修改file_write_obj.write('\n')file_write_obj.writelines(str(abstract_col[i]))file_write_obj.write('\n')file_write_obj.write('\n')
file_write_obj.close()
print "finish"
输出效果:
\subsection{[IEEE Wireless Communications Letters] Robust Cooperative Communication Optimization for Multi-UAV-Aided Vehicular Networks}
Aerial-ground cooperative vehicular networks are envisioned as a novel paradigm in B5G/6G visions. In this letter, the challenge of optimizing the global energy-efficiency (EE) of multi-UAV-aided vehicular networks in the presence of uncertain air-to-ground (A2G) channels is addressed. Specifically, we propose a maximin paradigm to characterize the system, which aims to maximize its global EE meanwhile satisfying Quality-of-Service (QoS)-oriented data rate requirements in the worst-case situation. We theoretically derive a closed-form optimal solution for an embedded minimization subproblem under a parametric channel uncertainty set and thus develop a computationally tractable robust counterpart, which leads to a robust EE optimization design. Simulation results show that the proposed method significantly outperforms conventional EE schemes in terms of achieving higher global system performance and better robustness under random uncertain environments.
这篇关于【python】批量导出IEEE的文献信息为段落文本的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!