I'm aware that similar questions have been asked here but I still believe my task is more complex.
I have a text file with information from the project geonames.org named MX.txt where data is arranged like this:
MX 20158 Villas del Cobano Aguascalientes AGU Aguascalientes
001 Aguascalientes 01 21.8495 -102.3052 1
MX 20158 Hacienda el Cobano Aguascalientes AGU Aguascalientes
001 Aguascalientes 01 21.8495 -102.3052 1
MX 20159 Alianza Ferrocarrilera Aguascalientes AGU Aguascalientes
001 Aguascalientes 01 21.8495 -102.3052 1
MX 20159 Bosques del Prado Oriente Aguascalientes AGU Aguascalientes
001 Aguascalientes 01 21.8495 -102.3052 1
MX 20160 Francisco Guel Jimenez Aguascalientes AGU Aguascalientes
001 Aguascalientes 01 21.7561 -102.305 1
MX 20160 Las Viñas INFONAVIT Aguascalientes AGU Aguascalientes
001 Aguascalientes 01 21.7561 -102.305 1
MX 20164 Santa Anita 4a Sección Aguascalientes AGU Aguascalientes
001 Aguascalientes 01 21.7561 -102.305 1
the file goes on for several thousand rows.
I'd like to turn this to a data frame with 12 variables where strings like "Villas del Cobano" are only one entry like this:
V1 V2 V3 V4 V5 V6
MX 20158 Villas del Cobano Aguascalientes AGU Aguascalientes
V7 V8 V9 V10 V11 V12
001 Aguascalientes 01 21.8495 -102.3052 1
V1 V2 V3 V4 V5 V6
MX 20158 Hacienda el Cobano Aguascalientes AGU Aguascalientes
V7 V8 V9 V10 V11 V12
001 Aguascalientes 01 21.8495 -102.3052 1
I already tried previous answers posted here like: Converting text file into data frame in R , converting multiple lines of text into a data frame
Because English is no my first languaje, I'd like to answer questions if my question is not clear enough through the comment section instead of getting negative flags.
Thanks in advance!