Hello, my problem is this:
I am doing a Python algorithm that reads some data from Excel that has the following format:
code_id,name,description,code_relation
www.dataware.org@444,nameA,Texto
Text Text,"code(RR)
www.dataware.org@555,nameB,LITLE TEXT,"code(FF)
www.dataware.org@666,nameC,
Texto
Text
Text
,"code(YY)
The data starts with a web page followed by @id and ends with "code(??)
How can I make a function in python to do a Slipt and get the data as follows:
id,name,description
The result for the above would be
vector =
[
"
@444,nameA,Texto
Text Text,
",
"
@555,nameB,LITLE TEXT
",
"
@666,nameC,
Texto
Text
Text
"
]
What I need is a split that gets me the intermediate text between:
- www.dataware.org@
- ,"code(??)
I would appreciate your help.
Since it's a single text, you can use regular expressions to find the first match to the URL, then use text to find the code, and then match the text to where the code ends. That is, you remove the text you have already used and iterate again until there are no more matches.