加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
concatenate_file.py 571 Bytes
一键复制 编辑 原始数据 按行查看 历史
randerson112358 提交于 2018-09-03 00:26 . Update concatenate_file.py
# This program concatenates multiple files in the form fit1, fit2, fit3, ... fit24
# into one file called out.csv
fout=open("out.csv","a")
# first file:
for line in open("<full_path>/fit1.csv"):
fout.write(line)
# now the rest:
for num in range(2,25): #You can change the number of files to concatenate by changing 25 to a different number Note: range(2,25) is exclusive [2,25)
f = open("<full_path>/fit"+str(num)+".csv")
next(f) # skip the header
for line in f:
fout.write(line)
f.close() # not really needed
fout.close()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化