Results 1 to 6 of 6

Thread: Extract Items from String and then Sort

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Extract Items from String and then Sort

    I have a string that contains items that I need to extract and sort. Items are those that are preceded by "with", "and", "comprising", and "," followed by their values (enclosed in parenthesis). After items are extracted, I want to re-arrange them from the original format "item description (value)" to the new format "(value) item description". After this, I want to sort the items based on their values, and place all the items inside the <ITEM> tag separated by "#"

    For example:
    I have a pet project comprising aluminum wire (100), paper (5), and sticks (2).

    Desired output:
    (2) sticks#(5) paper#(100) aluminum wire

    I have attached a representative sample to best illustrate this.

    This is a bit complicated so I'm asking anyone for ideas on how best to approach this.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •