# -*- coding: utf-8 -*-

"""
@Time    :  2023/2/21 11:28
@Author  : 
@FileName: 
@Software: 
@Describe:
"""
import os
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__':

    path = '../data/11篇txt'
    path_new = '../data/11篇汇总txt.txt'
    path_list = []
    data = []

    for file_name in os.listdir(path):
        path_list.append(file_name)
    for docx_name in path_list:
        df_list_new = []
        with open(path + "/" + docx_name, 'r', encoding="utf-8") as f:
            lines = [x.strip() for x in f if x.strip() != '']
        data.extend(lines)
        data.append("+++++++++++++++++++++++++++++++++++++++++++++++++@@@@@@@@@@@@@@@@@@@")


    with open(path_new, "w", encoding='utf-8') as file:
        for i in data:
            file.write(i + '\n')
        file.close()