I have a small data set to clean. I have opened the text file in Pycharm. The data set is like this:
Code-6667+
Name of xyz company+
Address +
Number+
Contact person+
Code-6668+
Name of abc company, Address, number, contact person+
Code-6669+
name of company, Address+
number, contact person +
I need to separate the code lines and concatenate (or paste) the rest of the lines together till the next code line comes. This way I could separate my data into 2 fields, namely, the code of the company and secondly all the details all in one field. The eventual output being a table. The output should be something like this :
Code6667 - Company details
Code6668 - Company details
Is there a way I could use a loop to do this? Tried this in R programming but now attempting it in Python.