Jump to content
UBot Underground

[Solved] How to remove unnecessary items from a list


Recommended Posts

How would I remove items from a list like this that do not contain an address? I have tried a loop through list total and if commoand find regex but I cannot get it to loop. It must be my regex which is:

^\b\d+\s\w+\s\w+\b$

as well as \d{1,3}.?\d{0,3}\s[a-zA-Z]{2,30}\s[a-zA-Z]{2,15}

 

 

 

Homes

9 Merilane

1712 Mount Curve Avenue

4830 N Fremont Avenue N

5020 Blake Road

2505 E Lake Of The Isles Parkway

4805 Bywood Street W

3209 Galleria Unit: 1808

8 Park Lane

4913 Rolling Green Parkway

4924 Green Farms Circle

4700 Annaway Drive

5 Spur Road

4218 Fremont Avenue S

2104 Kenwood Parkway

4612 Edgebrook Place

14 Bello Drive

1903 Mount Curve Avenue

6708 Cheyenne Trail

1324 Mount Curve Avenue

1600 Mount Curve Avenue

2232 W Lake Of The Isles Parkway

7432 Shannon Drive

72 Groveland Terrace

31 Cooper Circle

7333 Auto Club Road

2544 W Lake Of The Isles Parkway

1724 Colfax Avenue S

301 Kenwood Parkway Unit: 401

100 3rd Avenue S Unit: 2301

3150 Calhoun Parkway W Unit: 503

2516 Lake Of The Isles Parkway W

2603 Newton Avenue S

1715 Dupont Avenue S

5200-32 France Avenue S

1923 Knox Avenue S

3742 W Calhoun Parkway

7123 Antrim Court

5739 Long Brake Circle

10230 28th Avenue N

1715 James Avenue S

6604 Indian Hills Road

4612 Merilane Avenue

5800 Hidden Lane

5901 Lee Valley Road

1315 Mount Curve Avenue

4602 Sunnyside Road

6936 Valley View Road

4256 Linden Hills Boulevard

4402 Browndale Avenue

5533 Brookview Avenue

Send

Close

Sign Up

Submit

Sign In

CLOSE

Save

Edited by RATPFINK
Link to post
Share on other sites

Use this:

clear list(%list1)
clear list(%filtered)
add list to list(%list1, $list from text("9 Merilane
1712 Mount Curve Avenue
4830 N Fremont Avenue N
5020 Blake Road
2505 E Lake Of The Isles Parkway
4805 Bywood Street W
3209 Galleria Unit: 1808
8 Park Lane
4913 Rolling Green Parkway
4924 Green Farms Circle
4700 Annaway Drive
5 Spur Road
4218 Fremont Avenue S
2104 Kenwood Parkway
4612 Edgebrook Place
14 Bello Drive
1903 Mount Curve Avenue
6708 Cheyenne Trail
1324 Mount Curve Avenue
1600 Mount Curve Avenue
2232 W Lake Of The Isles Parkway
7432 Shannon Drive
72 Groveland Terrace
31 Cooper Circle
7333 Auto Club Road
2544 W Lake Of The Isles Parkway
1724 Colfax Avenue S
301 Kenwood Parkway Unit: 401
100 3rd Avenue S Unit: 2301
3150 Calhoun Parkway W Unit: 503
2516 Lake Of The Isles Parkway W
2603 Newton Avenue S
1715 Dupont Avenue S
5200-32 France Avenue S
1923 Knox Avenue S
3742 W Calhoun Parkway
7123 Antrim Court
5739 Long Brake Circle
10230 28th Avenue N
1715 James Avenue S
6604 Indian Hills Road
4612 Merilane Avenue
5800 Hidden Lane
5901 Lee Valley Road
1315 Mount Curve Avenue
4602 Sunnyside Road
6936 Valley View Road
4256 Linden Hills Boulevard
4402 Browndale Avenue
5533 Brookview Avenue
Send
Close
Sign Up
Submit
Sign In
CLOSE
Save ", "
"), "Delete", "Global")
loop($list total(%list1)) {
   add item to list(%filtered, $find regular expression($next list item(%list1), "^[0-9].+"), "Delete", "Global")
}

 

It will only add to list the item that started with numbers

Link to post
Share on other sites

Good use of Regex. Willywonka.

 

Code in just one node:

 

set(#clean, $find regular expression("9 Merilane
1712 Mount Curve Avenue
4830 N Fremont Avenue N
5020 Blake Road
2505 E Lake Of The Isles Parkway
4805 Bywood Street W
3209 Galleria Unit: 1808
8 Park Lane
4913 Rolling Green Parkway
4924 Green Farms Circle
4700 Annaway Drive
5 Spur Road
4218 Fremont Avenue S
2104 Kenwood Parkway
4612 Edgebrook Place
14 Bello Drive
1903 Mount Curve Avenue
6708 Cheyenne Trail
1324 Mount Curve Avenue
1600 Mount Curve Avenue
2232 W Lake Of The Isles Parkway
7432 Shannon Drive
72 Groveland Terrace
31 Cooper Circle
7333 Auto Club Road
2544 W Lake Of The Isles Parkway
1724 Colfax Avenue S
301 Kenwood Parkway Unit: 401
100 3rd Avenue S Unit: 2301
3150 Calhoun Parkway W Unit: 503
2516 Lake Of The Isles Parkway W
2603 Newton Avenue S
1715 Dupont Avenue S
5200-32 France Avenue S
1923 Knox Avenue S
3742 W Calhoun Parkway
7123 Antrim Court
5739 Long Brake Circle
10230 28th Avenue N
1715 James Avenue S
6604 Indian Hills Road
4612 Merilane Avenue
5800 Hidden Lane
5901 Lee Valley Road
1315 Mount Curve Avenue
4602 Sunnyside Road
6936 Valley View Road
4256 Linden Hills Boulevard
4402 Browndale Avenue
5533 Brookview Avenue
Send
Close
Sign Up
Submit
Sign In
CLOSE", "\\d\{1,4\}.?\\d\{0,4\}\\s[a-zA-Z,0-9]\{1,30\}\\s[a-zA-Z]\{1,15\}[a-zA-Z,0-9]\{1,30\}.*"), "Global")

  • Like 2
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...