I want to extract some data from a text file to a dataframe :
the text file look like this
URL: http://www.nytimes.com/2016/06/30/sports/baseball/washington-nationals-max-scherzer-baffles-mets-completing-a-sweep.html
WASHINGTON — Stellar .... stretched thin.
“We were going t......e do anything.”
Wednesday’s ... starter.
“We’re n... work.”
The Mets did not scor....their 40-37 record.
URL: http://www.nytimes.com/2016/06/30/nyregion/mayor-de-blasios-counsel-to-leave-next-month-to-lead-police-review-board.html
Mayor Bill de .... Department.
The move.... April.
A civil ... conversations.
More... administration.
URL: http://www.nytimes.com/2016/06/30/nyregion/three-men-charged-in-killing-of-cuomo-administration-lawyer.html
In the early..., the Folk Nation.
As hundreds ... wounds.
For some...residents.
On Wednesd...killing.
One ...murder.
It contains the URL and the text from new york times articles, I want to create a dataframe of 2 columns, the first one being the URL and the second one being the text.
The issue I have is that I couldn't deal with the Delimiters as there are two new lines between the URL and the corresponding text. But there are single new lines also in the text itself.
I tried using this code, but instead of getting a 2 column dataframe, I got a single column with a new row for each newline used, so it is also separating the text into multiple paragraphs, I am using dask btw :
df_csv = dd.read_csv(filename,sep="\n\n",header=None,engine='python')