• Login
Community
  • Login

Extracting some elements from the string

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 208 Views
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.
  • R
    Rafal Jonca 0
    last edited by Jan 14, 2021, 5:17 PM

    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,

    A 1 Reply Last reply Jan 14, 2021, 6:10 PM Reply Quote 0
    • A
      astrosofista @Rafal Jonca 0
      last edited by Jan 14, 2021, 6:10 PM

      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
      • R
        Rafal Jonca 0
        last edited by Jan 14, 2021, 6:54 PM

        Works beautifully. Thank you :)

        1 Reply Last reply Reply Quote 1
        2 out of 3
        • First post
          2/3
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors