I need to make a dataframe from two txt files.

The first txt file looks like this **Street\_name *space* id**.
The second txt file loks like this **City\_name *space* id**.

Example:

**text file 1:**

```
Roseberry st 1234
Brooklyn st 4321
Wolseley 1234567

```

**text file 2:**

```
Winnipeg 4321
Winnipeg 1234
Ste Anne 1234567

```

I need to make one dataframe out of this. Sometimes there is just one word for Street\_name, and sometimes more. The same goes for City\_name.

I get an error: *ParserError: Error tokenizing data. C error: Expected 2 fields in line 5, saw 3* because I'm trying to put both words for street name into the same column, but don't know how to do it. I want one column for street name (no matter if it consists of one or more words, one for city name and one for id.

I want a df with 3 rows and 3 cols.

Thanks!

Edit: both text files are huge (each 50 mil rows +) so i need this code not to break and be optimised for large files.