Sorting Plain Text in Dynamo

I have a list from HTML in plain text showing a list of families and their file size. I am having difficulty sorting this as desired. I want to separate the list of families and their size from the rest of the data, then sort that by family size, then get a count of those over 1000KB. I am obviously doing something wrong, I am just to new to this to realize/understand what that is.

Here is what I have:

Edit: Updated picture to reflect updated efforts <402> is the qualifier for the loaded families in the data set.
Thoughts?

Hey,

Just before we start… if your goal is just to count the quantity over 1000kb, you can ignore the name… just isolate the sizes, convert to number and test… Much simpler than tracking the name & keeping your lists consistent.

It would be a lot easier to assist if you posted the html…

Otherwise there’s going to be a lot of String Splitting, list management and sorting by key…

You want to know the bit of text before the family name (so you get get index 1) as well as after the file size (which your KB is doing? To get index 0).

Once you’ve got that as a single string for each family, you can then split it to make a list for each family, isolate the name (index 0) and number (index 1), then convert the size to a number to use in sorting…

I think you can use the size number as the key (index 1) to sort by key on the name (index 0) assuming the size numbers are unique…

Hopefully that gives some pointers :slight_smile:

Mark

1 Like

@Mark.Ackerley I cant post all the HTML as I was using a clients project as a test to see how it worked live(Its medical and they get weird about sharing data). I can probably post the section I want the data from though.
The issue I have is the string manipulation i need to perform is currently a smidge over my head. I like learning dynamo because its visual, which is helpful, I just haven’t gotten that far into it.

Here’s the relevant section, apologies if this isn’t the correct way to post this data:

</div>
![ERROR|26x26](upload://pq5GBa51dDYdzwFPQryLPJ3m8E9.png)
Loadable Families
List of loadable families ordered by file size.
    <div class="portalHeadlineText" style="margin - top: 15px">Result: 159,056 KB</div>
    <div class="tableScroll">
Name Value
Haworth_XSeries-Mobile_Pedestal 956 KB
Viking Sprinkler 952 KB
BWA Cabinet_Pantry 896 KB
BWA Toilet_Elongated_SMARTBIM 892 KB
Trane - Air-Cooled Scroll Packaged Chiller - CGAM TAG(CGAM 120T WITH PUMP BUFFER TANK) 0901041821 868 KB
BWA Personnel-Lift_Vertical-Platform_Harmar_Highlander-ST 824 KB
Door-Curtain_Wall-Kawneer-AA425_&_AA250 788 KB
BWA WasherDryerStack_PWT6089_PT7189_Miele 756 KB
Haworth_Worksurface_Compose-Convergent_Rectangular 712 KB
Building_(1) 700 KB
Entrance 676 KB
BWA Couch-Both_Arms-Generic 656 KB
Concealed_Vertical_Fan_Coil_Unit_-_FHC_-_IEC_-_2-Pipe_Cool-EHeat_2015 640 KB
BWA 812_Grab_Bars 640 KB
Haworth_Worksurface_Compose-Convergent_D-shaped 616 KB
Haworth_Chair_Zody-Guest 608 KB
BWA Shower-Head_ADA-w-Adjustable-Bar_SMARTBIM 600 KB
BWA Mailboxes_4C-5_Door_High_Units 6,140 KB
BWA Treadmill_SMARTBIM 592 KB
BWA-Shower-Base_with Controls 568 KB
BWA Hydration_Station-Haws_Corporation_Hydration_Surface_Mount 564 KB
BWA Toilet-Acc_Custodial-Acc_ASI_1308-3 548 KB
BWA Toilet-Acc_Shower_Seat_ASI_8204 548 KB
Ornamental_Fence_5109 548 KB
Sofa-Corbu 544 KB
BWA Towel Bar 544 KB
Chair-Corbu 540 KB
BWA Chair_Modern-2_SMARTBIM 540 KB
BWA Container-Chutes_International-CY_Container_Front_Loading 536 KB
BWA Sideboard_SMARTBIM 532 KB
BWA Countertops-Inpro-Prism_Blank-IDS-16-HD 516 KB
BWA Trash_Chute_Chutes 500 KB
BWA Mailboxes 4C-10_Door_High_Units_FL 5,100 KB
BWA Washer_PW_6080_Miele 484 KB
Vanity Wall Light 480 KB
BWA Bike-Excercise_SMARTBIM 480 KB
BWA Table-Night_Collection-1_SMARTBIM 476 KB
BWA TVChest_2Drawer-Mission_SMARTBIM 476 KB
Kawneer-TRIFAB_VG_451_Center_SS_Horizontal 468 KB
BWA Sprinkler 468 KB
BWA Dryer_PT_7186_Miele 460 KB
BWA EXT-Building-Single Door-kawneer-190-sgl-ctr-01_17316 456 KB
Sconce Lamp - Fusiform - LED 456 KB
Door_Panel-Kawneer-Glass 452 KB
Kawneer-1600_Sys_2_6 Profile_Horizontal 452 KB
BWA 212 ADA 448 KB
BWA 212 448 KB
BWA Toilet_Tissue_Dispenser-Bobrick-B2888-Multi_Roll-Surface_Mounted 448 KB
BWA Paper_Towel_Dispenser_And_Waste_Receptacle-Bobrick-B3944-Convertible-Recessed 448 KB
BWA 211 ada 448 KB
Kawneer-TRIFAB_VG_451_Center_SS_Sill 448 KB
BWA 211 448 KB
BWA Soap_Dispenser-Surface_Mounted-Bobrick 444 KB
Kawneer-1600_Sys_2_6 Profile_Sill 440 KB
Sprinkler - Pendent - Hosted 440 KB
Kawneer-TRIFAB_VG_451_Center_SS_Head 440 KB
Kawneer-1600_Sys_2_6 Profile_Head 440 KB
BWA 312 436 KB
BWA Trendy_Dining_Chair_8118 436 KB
BWA Medicine_Cabinet-Bradley_Corp-9663 432 KB
Trendy_Dining_Chair_8118 432 KB
Kawneer-TRIFAB_VG_451_Center_SS_Jamb_R 428 KB
BWA Wall_Sink_530 428 KB
BWA Toilet_Tissue_Dispenser-Bradley_Corp-508 428 KB
Adirondack_chair_13489 428 KB
BWA Range_Hood-Kenmore-Convertible_Range_Hood-30in_160_ cu_ft 424 KB
BWA 254 ada 424 KB
BWA 254 424 KB
BWA 152 420 KB
Kawneer-TRIFAB_VG_451_Center_SS_Jamb_L 416 KB
Roof Drain 412 KB
BWA 102 412 KB
BWA Faucet_Janitorial_SMARTBIM 408 KB
RPC Shrub 404 KB
BWA 311 404 KB
BWA Refrigerator_Single-Door_SMARTBIM 404 KB
BWA Oven_Built-In_Trivection_SMARTBIM 404 KB
101 404 KB
BWA ADA Shower Grab-Bar_Corner-2_SMARTBIM 400 KB
BWA Graphic Scales_Arch AEC6_Arch 400 KB
BWA Drinking-Fountain_SMARTBIM 400 KB
BWA Double-Flush 4,412 KB
Kawneer-1600_Sys_2_6 Profile_Jamb_R 396 KB
1701-Haywood House-Border_ARCH D_24x36_BWA 396 KB
BWA TV - Square 396 KB
BWA Shower Curtain Rod 392 KB
BWA Sink Kitchen-Single 392 KB
Roof_Drain_2842 392 KB
BWA Surface-Mounted_Double_Robe_Hook-Bobrick-B-672 392 KB
BWA Shower Base P6030E75B 392 KB
Condenser for VPAC - Air Cooled - 10-15 Tons 392 KB
BWA Panel_ADA-Under-Sink-Access_SMARTBIM 388 KB
BWA Built-in_Shelving_7730 388 KB
Kawneer-1600_Sys_2_6 Profile_Jamb_L 384 KB
Vanity Cabinet-Double Door & 4 Drawer 384 KB
AlcoveRecessed_Upholstered_Bench_11271 384 KB
BWA Versatex-Window Trim 384 KB
Park Bench 384 KB
BWA Graphic Scales_Civil AEC6_Civil 380 KB
RPC Tree - Deciduous 380 KB
Kawneer-Trifab_400_Sill 376 KB
Kawneer-Trifab_400_Vertical 376 KB
Desk 376 KB
Kawneer-Trifab_400_Jamb 2 376 KB
Condensing Unit - Air Cooled - DX - 6-10 Tons 372 KB
Vanity Cabinet-Single Door & 2 Drawer 368 KB
BWA Graphic Scales_Arch NCS5 368 KB
Graphic Scales_Arch NCS5 364 KB
Range1 364 KB
BWA Versatex-Corner-1 364 KB
Street Light - Antique 360 KB
BWA Versatex-Trim 356 KB
BWA Table-Coffee-Rectangular_Collection-3_SMARTBIM 356 KB
BWA Sink - Mop 356 KB
Vanity Cabinet-Single Door 356 KB
BWA Rod-Shelf_Closet_SMARTBIM 356 KB
Light23IW-LED 352 KB
BWA Refrigerator 352 KB
Plan Swing 352 KB
BWA Table-End_Collection-3_SMARTBIM 352 KB
Parking Space - ADA 352 KB
Kawneer-Trifab_400_Horizontal 352 KB
Cook Top-4 Unit 348 KB
Bed-Standard 348 KB
BWA Bed-Standard 348 KB
Kawneer-Trifab_400_Jamb 1 348 KB
Surface Mounted Decorative Light 344 KB
Recessed Downlight 344 KB
Ceiling Light - Flat Round 344 KB
Pendant Light Fixture 344 KB
Ceiling Light - Linear Box 344 KB
Kawneer-1600_Sys_2_6 Profile_Vertical 344 KB
Haywood Key Plan 340 KB
Entry Door Shelf 340 KB
Bench-Locker Room 340 KB
Handrail - Round w Extension - Start-Offset 340 KB
Baluster - Round4 336 KB
Toposurface Placement 336 KB
BWA Table-Rectangular 336 KB
Counter Top-L Shaped 336 KB
Frame-Curtain_Wall-Kawneer-AA425_&_AA250 336 KB
BWA Shelving 336 KB
Bike Stand 332 KB
BWA ADA Clearance Symbols 332 KB
Table-Rectangular 332 KB
Handrail - Bracket 332 KB
Heavy Load Wood Joist-Section 328 KB
Counter Top 328 KB
Elevation Marker-Interior-Body 328 KB
Handrail - Round w Extension - End 324 KB
Elevation Mark Body_Circle Exterior_NCS5 324 KB
Baluster - Round6 324 KB
Elevation Mark Body_Custom 324 KB
Exit Sign Symbol_USACE 324 KB
Graphic Scales_Arch_USACE 320 KB
Baluster - Round 320 KB
Round Column 320 KB
Elevation Mark Body_Circle_NCS5 320 KB
Square Supply Diffuser 320 KB
Kawneer-Trifab_400_Head 320 KB
Medium Load Wood Joist-Section 320 KB
Bond Beams-Single-Section 316 KB
Parking Space 316 KB
Caulking-Section 316 KB
Rectangular Column 316 KB
Project Starting View_USACE 316 KB
Exit Sign Annotation 316 KB
CMU-2 Core-Section 312 KB
Interior Metal Studs-Section 312 KB
Wood I Joist-Section 312 KB
Heavy Load Wood Joist-Side 312 KB
BWA North Arrow_NCS5 312 KB
Mullion-Kawneer-Trifab_601-Interior-2D 312 KB
North Arrow_NCS5 312 KB
Mullion-Kawneer-Trifab_601-Sill-2D 312 KB
Chair Rail Profile 308 KB
Mullion-Kawneer-Trifab_601-Left_Jamb-2D 308 KB
CH Stud-Section 308 KB
Interior Metal Runner Channels-Section 308 KB
Interior Light Gauge Zees-Section 308 KB
E Stud-Section 308 KB
Nominal Cut Lumber-Section 308 KB
Mullion-Kawneer-Trifab_601-Head&Right_Jamb-2D 308 KB
Interior Furring Hat Channels-Section 308 KB
Gypsum Wallboard-Section 308 KB
Border_ARCH_D_24x36_Cover_BWA_HAYWOOD 308 KB
Wood I Joist-Side 304 KB
Protection Board-Section 304 KB
Plywood-Section 304 KB
Interior Resilient Channel-Section 304 KB
Rigid Insulation-Section 304 KB
Border_ANSI_B_11x17_BWA 304 KB
Fascia Profile 304 KB
Plywood-Section1 304 KB
Border_ANSI_A_8.5x11_BWA 304 KB
Border_ANSI_B_11x17_PRESENTATION_BWA 304 KB
BWA Reveal - .5IN Square 304 KB
Ceiling HVAC Symbol 304 KB
Border_ARCH_D_24x36_PRESENTATION_BWA 304 KB
Soffit Profile 304 KB
BWA Reveal - 5-8 Square 304 KB
Border_ARCH_D_24x36_Cover_BWA 304 KB
Family1 304 KB
Metal Pan Profile 304 KB
J Runner-Section 304 KB
Break Line 300 KB
BWA Wall Tag 300 KB
Fire Smoke Symbol_USACE 300 KB
KeyPlan_Areas 300 KB
BWA Glazing Tag Dummy 300 KB
Elevation Marker-Interior-Pointer 300 KB
BWA Keynote Tag1 300 KB
BWA Window Tag Dummy 300 KB
LB_MRL-Psgr-SSCO-FO-RCWT 3,224 KB
Grid Head 2 296 KB
BWA Area Tag W Unit Type 296 KB
Elevation Mark Pointer_Circle_NCS5 296 KB
BWA Window Tag by Type 296 KB
Coded Note 296 KB
BWA Coded Note 296 KB
Section Head - Filled NCS5_USACE 296 KB
Coded Note Small 296 KB
BWA Keynote Tag 296 KB
BWA Wood Top Rail 296 KB
Room Tag_NCS5 296 KB
BWA Door Tag by Number 296 KB
Room_Occupancy_Classification_Tag_USACE1 296 KB
BWA Door Tag by Type 296 KB
Light Fixture Symbol 296 KB
Elevation Mark Pointer_Circle Exterior_NCS5 296 KB
Room_Occupancy_Classification_Tag_USACE 296 KB
Room Hazard Occupancy Tag_USACE 296 KB
Gutter Profile-Bevel 296 KB
Furniture Tag_NCS5 292 KB
Window Tag_NCS5 292 KB
Keynote DEMO 292 KB
Door Tag NCS5 292 KB
Callout Head - w-Dash_NCS5 292 KB
Level Head - Circle_NCS5 292 KB
Slab Edge-Thickened 292 KB
Section Tail - Filled_NCS5 292 KB
Keynote ELEVS 292 KB
Sheet Keynote - Hexagon_USACE 292 KB
Level Head - Circle 292 KB
View Title 292 KB
View Title - Reference Sheet_NCS5 292 KB
View Title w Sheet_USACE 292 KB
View Title - Reference Sheet_NCS1 292 KB
Furniture Tag_NCS1 292 KB
Revision Tag 292 KB
View Title_NCS5 292 KB
View Title - Reference Sheet_NTS_NCS5 292 KB
BWA Area Tag - Rounded 3-32 292 KB
View Title_NCS 292 KB
M_Level Head - Circle 292 KB
BWA Level Head - Circle 292 KB
Elevation Mark Pointer_Interior 292 KB
Fascia-Flat 292 KB
Level Head - Circle1 292 KB
BWA View Title - Circle 3-16 292 KB
Stair Nosing - Pan 292 KB
Circular Handrail 292 KB
BWA View Title - Circle 292 KB
Spot Elevation - Target Filled 292 KB
Sprinkler - Concealed Annotation 288 KB
Grid Head - Circle_NCS1 288 KB
Sprinkler - Exposed Annotation 288 KB
BWA Occupancy Label 288 KB
Smoke Detector Carbon Monoxide Annotation 288 KB
Smoke Detector Annotation 288 KB
Wall Tag - Square_NCS5 288 KB
Grid Head - Circle_NCS5 288 KB
Spot Elevation - Crosshair 288 KB
Egress Route_Tag 288 KB
Stair Nosing - Radius1 288 KB
Ceiling Height_USACE 288 KB
Material Name Tag 288 KB
Callout Head 288 KB
BWA Single-Flush 2,776 KB
BWA Single-Flush-Closer 2,696 KB
BWA Single-Flush-Vision 2,680 KB
BWA Single-Flush-Full Glass 2,660 KB
PC 2,640 KB
BWA Single-Half Glass 2,636 KB
BWA Single-Flush-Glass-Egress 2,636 KB
BWA Window_Double-Hung-3-Wide-Traditional_Kolbe 2,456 KB
BWA Window_Double-Hung-2-Wide-Traditional_Kolbe 2,188 KB
BWA Mailbox_4C_10_Door_High_Units 2,036 KB
BWA Window_Double-Hung-1-Wide-Traditional_Kolbe 1,896 KB
Haworth_Patterns-Workwall-Architectural 1,528 KB
Wall Sconce Light Fixture 12 IN WALL 1,340 KB
Wall Sconce Light Fixture 1,340 KB
Haworth_Chair_Zody-Task 1,320 KB
BWA Vanity_Tops-Inpro-Prism_Top_with_Sink-Single-Undermount-IDS-30-HD 1,312 KB
BWA Mini-MAC_COMPACTOR_6308 1,052 KB
Corral_Bollard_10628 1,012 KB
I don't know how to get it to show up in here as the plain text. Apologies for any confusion
1 Like

Hey,

Apologies I’m away from a PC so can only give limited help right now… So like with the size, you know it is always just before ‘kb’ can you use a similar technique to isolate the name? is there a name regular expression? Can you use
String Separator to isolate that part?

It’s going to be a bit of a slog because Dynamo doesn’t have very sophisticated string manipulating nodes…

If you can get a single string containing the name and size that would be helpful…

Is string separator from a package? I don’t seem to see it pulling up when I search for it. Ill hunt around and let you know if that works.
Thank you!

You used a separator in your graph…

Definitely good to dig around and see what other nodes are available…

As I say string to number & sort by key are likely useful :slight_smile:

Is the separator you are referring to the " < div > "? I just tried to copy/paste the relevant bit from my HTML

Edited for clarity

Have a look at this…

HTML to Useful Info Family Size.dyn (84.7 KB)

Thanks to @Dimitar_Venkov for some very cute Design Script.

Hope that works,

Mark

2 Likes

That works perfectly! Thank you @Mark.Ackerley! Thank you @Dimitar_Venkov!

This is perfect! My logic always seems to fall apart in string manipulation, I’ll have to really study up on this after the holiday.

Thank you both again!

Edited: Spelling

1 Like