1
1
180Ringing2021-10-15 15:52:15
Python
180Ringing, 2021-10-15 15:52:15

How to parse CSV by CRLF?

There are 2 types of Carriege return - CR \r, 0x0D and Line Feed - LF, \n, 0x0A
And their combination CRLF - 0x0D0A
In the CSV file I'm parsing there are lines that are wrapped by LF and CRLF.
And while iterating

filecsv = reader('file.csv')
for i in filecsv :
    print(i)

I am getting strings by LF and I need to split them by CRLF into lists.
1. I think you can separate them using regular expressions, but how to do this in the filecsv object?
2. If this can be done using other libs, like pandas, tell me how?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question