import pandas as pd
import os
import glob

read_path = os.getcwd()
# print(read_path)

read_files = glob.glob(read_path+"/*.csv")

dir_path = 'kyouzai'

cols = ["HPtitle", "HPurl", "Hpnumber", "student", "evaluation", "text", "date"]
dd =pd.DataFrame(columns = cols)

colls = ["HPtitle", "HPurl", "Hpnumber", "student", "evaluation", "text", "date", "Credibility_score", " Score_average"]
ddd =pd.DataFrame(columns = cols)

for i in range(len(read_files)):
    os.makedirs(dir_path+str(i), exist_ok = True)
    read_file = read_files[i]
    df = pd.read_csv(read_file, encoding='utf-8')
    length = len(df)
    list=[]
    for j in range(len(df)):
        list.append(j)

    print(read_file)

    df['Hpnumber'] = list
    df['Credibility_score'] = ''
    df.to_csv("kyouzai"+str(i)+"/kyouzaiDB.csv", index=None, encoding="cp932",errors='ignore')
    dd.to_csv("kyouzai"+str(i)+"/review_prac.csv", index=None, encoding="cp932",errors='ignore')
    ddd.to_csv("kyouzai"+str(i)+"/review_score.csv", index=None, encoding="cp932",errors='ignore')



    