Navigation

    Community

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

    Remove every other character

    Help wanted · · · – – – · · ·
    3
    3
    199
    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.
    • Swag Potato
      Swag Potato last edited by

      I’ve opened a corrupted jpg file in notepad++ and noticed that every character is doubled. For example, instead of going “ÿØÿà JFIF” at the start, it goes “ÿÿØØÿÿàà JJFFIIFF”. This goes on for the whole 2456 lines. I want to know if there’s a way to remove every other character to make it normal again as I’m pretty sure this is the root of the corruption.

      Alan Kilborn 1 Reply Last reply Reply Quote 0
      • guy038
        guy038 last edited by

        Hello, @swag-potato and All,

        Weird request ! Anyway, @swag-potato, here is a solution :

        • Open the Replace dialog ( Ctrl + H )

          • SEARCH (\w)\1

          • REPLACE \1

          • Tick the Wrap around option

          • Select the Regular expression search mode

          • Click on the Replace All button

        Notes :

        • This regex change any doubled word character with this word char

        • If some non-word chars ( as :, # or €,… ) exist in your .jpg file, prefer the following search regex (?-s)(.)\1 !

        Best Regards

        guy038

        1 Reply Last reply Reply Quote 1
        • Alan Kilborn
          Alan Kilborn @Swag Potato last edited by

          @Swag-Potato said in Remove every other character:

          I’ve opened a corrupted jpg file in notepad++

          Editing a non-text file in Notepad++ is probably a pretty good way to ensure corruption, not eliminate it. My advice: Don’t do this.

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