I need to use Data Scraping in a text that contains the address of a place. The string follows a structure:
“This is the example of text
Address Rue De la Maison 23 another text
text text abcdf”
What I want to get is “De la Maison” and “23”.
Rue is a word that is shown after “Address” but it can be another word (Street, for instance). So I want to delete this first word after “Address”.
Also, the number of the address is always located after the name of the Address.
Thanks a lot!
EDIT: To sum up, I want to remove the first word of a string that contains a lot of words, and then i want to capture the first number of the remaining string and the previous words located before the number.
HI @EngAnalyst,
1.You can first split the string till address like str.split(“address”) .
2.Now take the second part of the split and split it again using space and remove the first element.
3. Initialize a string variable as str1=“” and add the the strings present in the split array which is done by space splitting by looping through it until there is a number.
4.You can check for number by keeping the if condition to convert the string to int and check for the number.
Cheers
Vashisht.
"Rue De la Maison 23 another text text text abcdf”
So I just need to remove the first word (Rue, Street,…whatever) and then capture the words that are shown before the number (De la Maison, …) and the number.
Thanks a lot srdjan.suc
It returns: Rue De la Maison 23
I need to remove the first word (Rue) and capture “De la Maison” and “23” in different strings.
Thank you very very much, we are very very close to the solution!