• Login
Community
  • Login

How to remove this symbols from txt file

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
10 Posts 4 Posters 1.4k 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.
  • M
    mohammad Al-Maaitah
    last edited by Dec 9, 2024, 9:57 AM

    hello I have txt file , and I want remove from it all this symbols
     etc … symbol.PNG

    1 Reply Last reply Reply Quote 0
    • G
      guy038
      last edited by guy038 Dec 9, 2024, 10:44 AM Dec 9, 2024, 10:41 AM

      Hello, @mohammad-al-maaitah and All,

      Very easy !


      • Open your file in Notepad++

      • Run the Edit > Character Panel menu option

      => As you can see, the SYN character is a Control C0 character, with decimal value = 22 and hexadecimal value = 16. Thus :

      • Open the Replace dialog ( Ctrl + H )

      • Un-check all the box options

      • Type in \x16 in the Find what : zone

      • Leave the Replace with: zone EMPTY

      • Check the Wrap around option

      • Select the Extended (\n, \r, \t, \0, \x...) or the Regular expression radio button

      • Click ,once only, on the Replace All button

      Voila !

      Best Regards,

      guy038

      M 1 Reply Last reply Dec 19, 2024, 7:55 AM Reply Quote 3
      • M
        mohammad Al-Maaitah @guy038
        last edited by Dec 19, 2024, 7:55 AM

        @guy038 well how to delete all symbols like sub dir etc which they in the txt file

        D 2 Replies Last reply Dec 19, 2024, 10:54 AM Reply Quote 0
        • D
          dr ramaanand @mohammad Al-Maaitah
          last edited by dr ramaanand Dec 19, 2024, 11:27 AM Dec 19, 2024, 10:54 AM

          @guy038 or anyone else, I also see many such, “symbols” in one of my files. How to get back the original text where these symbols are being displayed now? Some of the symbols are:

          "DC2", "SOH", "NUL", "STX", "x80", "x85", "x84", "xFA", "xFF", "BEL", "ETX", "STX", "ACK", "EOT" etc.
          
          P 1 Reply Last reply Dec 19, 2024, 2:30 PM Reply Quote 0
          • P
            PeterJones @dr ramaanand
            last edited by PeterJones Dec 19, 2024, 2:33 PM Dec 19, 2024, 2:30 PM

            @dr-ramaanand said in How to remove this symbols from txt file:

            I also see many such, “symbols” in one of my files.

            That likely means that the file you are looking at is not actually a text file (see our FAQ). If you are certain the file should be plain text (ie, it ends in .txt or similar), and the file now mostly consists of those symbols, then you might have a virus or malware or ransomware which is encrypting files to try to hold them hostage; in which case, I hope you have a backup. Or you might have zipped/gzipped the file (though normally, that would change the extension; of course, if you’ve hidden extensions in your OS, you might not know the actual extension of the file)

            OTOH, if it’s just a few extra symbols interspersed among the normal text, those characters sometimes get inserted if you use keystrokes that aren’t in your Shortcut Mapper – if all your normal text is there, but there are also a few of those, just delete them. Edit > Character Panel can show you a chart of the character codes vs the character/symbol, and you can use those to help figure out a regex to replace them if it’s more than a handful, but all your data is still there: for example, SYN in the Character column maps to the 16 in the Hex column, so that translates to a regex search of \x16 ; you can do a similar mapping for any others you find. But if it’s more than a few, then it’s probably not just accdidentally inserting of a few characters, and probably something happened outside of Notepad++ to corrupt your data – and Notepad++ cannot fix arbitrarily-corrupted data for you.

            Notepad++ may have also interpreted your file with the wrong encoding; you might want to change the MISC > Autodetect character encoding and reload the file. Or you might look at the Encoding menu and/or the status bar’s encoding field, and determine if it seems the right encoding for your file.

            How to get back the original text where these symbols are being displayed now?

            If it really has changed, rather than just not being the file you thought it was, then:

            • If it changed while Notepad++ was open, and you haven’t restarted Notepad++, use UNDO.
            • If it changed while it wasn’t open in Notepad++, then it’s not Notepad++'s fault, and there’s nothing Notepad++ or we can do to get your text back. If it’s a virus or malware, you’ll have to find a backup – but you’ll want to clean your system of the infection before accessing or restoring from that backup.
            • If it’s just a few Otherwise, you’ll have to go back to your
            D 1 Reply Last reply Dec 19, 2024, 3:38 PM Reply Quote 2
            • D
              dr ramaanand @PeterJones
              last edited by Dec 19, 2024, 3:38 PM

              @PeterJones Thanks for your detailed response. All those symbols are together. I think they were regular expressions. I think I opened that text file with Notepad once and now Notepad++ is showing those RegExes as meaningless symbols. Is there no way to re-convert those to the original text?

              P 1 Reply Last reply Dec 19, 2024, 3:46 PM Reply Quote 0
              • P
                PeterJones @dr ramaanand
                last edited by Dec 19, 2024, 3:46 PM

                @dr-ramaanand said in How to remove this symbols from txt file:

                @PeterJones Thanks for your detailed response. All those symbols are together.

                “together” really isn’t enough to go on.

                I think they were regular expressions. …
                now Notepad++ is showing those RegExes as meaningless symbols.

                Notepad++ doesn’t “show” regex as control characters. “Regular expressions” don’t somehow get magically embedded in your file.

                If you used a regular expression, and the transformation messed up your text, then that’s different. But that’s not what your phrasing says (it may just be a translation issue).

                Is there no way to re-convert those to the original text?

                If you used a regular expression, and messed up your text, then saved and exited Notepad++, you have lost any undo history. And I (and any other people in the Forum) have no way of knowing what regex you used that corrupted your data, and whether that regex could be “reversed” to undo it after the fact – but many regexes are destructive (especially the HTML regex you have been using in other discussions), so it’s likely the information has been lost. In which case, if you didn’t choose to keep a backup of your original data, then the data is lost, and there’s nothing I or others in the Forum can do to help with that. In the future, you need to keep a backup of your data until such point as you are sure no data has been lost; and when you use a regex to translate data, it is up to you to ensure that nothing was lost that you didn’t expect or otherwise incorrectly transformed – and you need to do that before getting to the point where you have exited Notepad++ and lost any ability to undo the change.

                D 1 Reply Last reply Dec 19, 2024, 5:20 PM Reply Quote 2
                • D
                  dr ramaanand @PeterJones
                  last edited by Dec 19, 2024, 5:20 PM

                  @PeterJones Okay, thank you very much. I appreciate your detailed response. I think you have understood these things from years of experience.

                  1 Reply Last reply Reply Quote 0
                  • D
                    dr ramaanand @mohammad Al-Maaitah
                    last edited by Dec 19, 2024, 5:23 PM

                    @mohammad-Al-Maaitah if they are in just one file, you can select and delete all of them but if it is in multiple files, let us know

                    D 1 Reply Last reply Dec 19, 2024, 5:29 PM Reply Quote 0
                    • D
                      dr ramaanand @dr ramaanand
                      last edited by dr ramaanand Dec 19, 2024, 6:27 PM Dec 19, 2024, 5:29 PM

                      @mohammad-Al-Maaitah if your first and last symbol is symbol.PNGyou can type \x16.*?\x16 in the Find field, tick the regular expression mode, leave the Replace field empty and click Replace in files (to remove it from multiple files). That will help you get rid of all of those (and anything else in between). There are no spaces anywhere in the middle, so I am explaining the same to you

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