Community
    • Login

    Extracting some elements from the string

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 361 Views 1 Watching
    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 0R Offline
      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,

      astrosofistaA 1 Reply Last reply Reply Quote 0
      • astrosofistaA Offline
        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 0R Offline
          Rafal Jonca 0
          last edited by

          Works beautifully. Thank you :)

          1 Reply Last reply Reply Quote 1

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors