import numpy as np
import pandas as pd
import networkx as nx
import matplotlib.pyplot as plt
import os,sys
import re
import random
data=open('test.txt','r')
textA_csv = []
textB_csv = []
label_csv = []
for line in data:
if not line:
break
pass
# textA,textB,label = [str(k) for k in line.split("\t")]
#--------------------------------------------------------------------
#--------------------------------------------------------------------
#--------------------------------------------------------------------
'''
textA_file = line.split("\t")[0]
textB_file = line.split("\t")[1].split("\n")[0]
f_textA_file=open("textA_file.txt", "a+")
new_context = textA_file + '\n'
f_textA_file.write(new_context)
f_textB_file=open("textB_file.txt", "a+")
new_context = textB_file + '\n'
f_textB_file.write(new_context)
'''
#--------------------------------------------------------------------
#--------------------------------------------------------------------
#--------------------------------------------------------------------
textA = line.split("\t")[0].replace(" ", "")
textB = line.split("\t")[1].split("\n")[0].replace(" ", "")
# textB = line.split("\t")[1].replace(" ", "")
# label = line.split("\t")[2].split("\n")[0].replace(" ", "")
label = "0"
textA_csv.append(textA)
textB_csv.append(textB)
label_csv.append(str(label))
A=pd.Series(textA_csv,name='A')
B=pd.Series(textB_csv,name='B')
L=pd.Series(label_csv,name='L')
lll=pd.concat([A,B,L],axis=1)
lll.to_csv('test.csv')