Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Extracting some elements from the string

    Help wanted · · · – – – · · ·
    2
    3
    46
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Rafal Jonca 0
      Rafal Jonca 0 last edited by

      Hello,

      Maybe I will show what I mean.

      I have this:

      "bbox":[32614000.00000020,5743999.99999951,32616000.00000020,5745999.99999956],"coordinates":[[[32614000,5745999.99999956],[32616000,5745999.99999952],[32616000,5743999.99999951],[32614000,5743999.99999956],[32614000,5745999.99999956]]]},"properties": {"id": "571553","label": "326145744"}},{"type": "Feature","geometry":  "bbox":[32614000.00000020,5747999.99999951,32616000.00000020,5749999.99999956],"coordinates":[[[32614000,5749999.99999956],[32616000,5749999.99999951],[32616000,5747999.99999951],[32614000,5747999.99999956],[32614000,5749999.99999956]]]},"properties": {"id": "571554","label": "326145748"}},{"type": "Feature","geometry":  "bbox":[32614000.00000020,5751999.99999951,32616000.00000020,5753999.99999956],"coordinates":[[[32614000,5753999.99999956],[32616000,5753999.9999995],[32616000,5751999.99999951],[32614000,5751999.99999956],[32614000,5753999.99999956]]]},"properties": {"id": "571555","label": "326145752"}},{"type": "Feature","geometry":
      
      

      And I need this:

      571553,571554,571555
      
      

      How to extract that ?

      Thank you,

      astrosofista 1 Reply Last reply Reply Quote 0
      • astrosofista
        astrosofista @Rafal Jonca 0 last edited by

        Hi @Rafal-Jonca-0

        I think this regex will do the trick:

        Search: (?-s).*?"id": "(\d+).*?|.*
        Replace: ?1$1,
        

        Put the caret at the very beginning of the document, select just the Regular Expressions mode and click on Replace All. That’s all.

        Take care and have fun!

        1 Reply Last reply Reply Quote 4
        • Rafal Jonca 0
          Rafal Jonca 0 last edited by

          Works beautifully. Thank you :)

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          Copyright © 2014 NodeBB Forums | Contributors