Community

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

    Regex - Find in Files.. and remove all files that contain any characters other than letters and numbers

    Help wanted · · · – – – · · ·
    3
    4
    2019
    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.
    • Stas
      Stas last edited by

      Hello! Please help!

      1. I need to delete all files that contain any characters other than letters and numbers.

      2. Remove any characters other than letters and numbers in all txt files.

      Claudia Frank 1 Reply Last reply Reply Quote 0
      • Stas
        Stas last edited by

        But best of all is the ability to list all the characters that are in some documents. Then remove all these documents or replace these symbols on any others.

        1 Reply Last reply Reply Quote 0
        • Claudia Frank
          Claudia Frank @Stas last edited by

          @Stas

          a regex can modify text but cannot delete files.

          Cheers
          Claudia

          1 Reply Last reply Reply Quote 0
          • Vasile Caraus
            Vasile Caraus last edited by

            You can to this. make a search and replace in all files with Regular Expression:

            1. Search [~}{@%.!)]*(?&$#,=/[^+-]
            2. Replace by (leave empty)

            This will delete all the special characters from files, and will remain only letters and numbers.

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