================================================== ==== Title: Whole case Location: oyuri From: Aki Date: 2018/11/30 (Friday) 11:55:29 ================================================== ===== 1: Aki 2018/12/05 (Wed) 17:33:17 " An approval notice has been sent. -------------------------------------------------- ------------------ 2: Aki 2018/12/06 (Thursday) 17:14:30 I was notified by Mr. Id, the agent of the other party. -------------------------------------------------- ------------------ 3: kano, etc. 2018/12/07 (Friday) 11:44:45 Please call rito. -------------------------------------------------- ------------------
This Is my text file which I have converted to a CSV the only problem I’m facing is when there is a double quote(“) in the file (for example here in this file in entry number 1 ) how can I ignore the double quote while reading the CSV file? the separator I’m using while reading the file is n
df = pd.read_csv(filename ,sep='n', header=None)
Answer
Here it is:
df = pd.read_csv('sample.csv' ,sep='n', header=None, quotechar="'") print(df) #output: 0 0 ==============================================... 1 Title: Whole case 2 Location: oyuri 3 From: Aki 4 Date: 2018/11/30 (Friday) 11:55:29 5 ==============================================... 6 1: Aki 7 2018/12/05 (Wed) 17:33:17 8 " 9 An approval notice has been sent. 10 ----------------------------------------------... 11 2: Aki 12 2018/12/06 (Thursday) 17:14:30 13 I was notified by Mr. Id, the agent of the oth... 14 ----------------------------------------------... 15 3: kano, etc. 16 2018/12/07 (Friday) 11:44:45 17 Please call rito. 18 ----------------------------------------------...