You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
806 B
32 lines
806 B
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
@Time : 2023/2/2 11:29
|
|
@Author :
|
|
@FileName:
|
|
@Software:
|
|
@Describe:
|
|
"""
|
|
|
|
def read_text(file):
|
|
try:
|
|
with open(file, 'r', encoding="utf-8") as f:
|
|
lines = [x.strip() for x in f if x.strip() != '']
|
|
except:
|
|
with open(file, 'r', encoding="gbk") as f:
|
|
lines = [x.strip() for x in f if x.strip() != '']
|
|
return lines
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
data = []
|
|
# path_list = ["train_yy_sim_10.txt", "train_yy_1_sim_10.txt"]
|
|
path_list = ["../data/train_yy.txt", "../data/train_yy_1.txt"]
|
|
for i in path_list:
|
|
data += read_text(i)
|
|
fileName = '../data/train_yy_zong.txt'
|
|
with open(fileName, 'w', encoding='utf-8') as file:
|
|
for i in data:
|
|
file.write(str(i) + '\n')
|
|
file.close()
|