ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Clean a Linux or UNIX Text File to Strip Hidden Characters

    IT Discussion
    linux unix text bash string
    2
    3
    2.0k
    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.
    • scottalanmillerS
      scottalanmiller
      last edited by

      Working with Postfix and got some hidden characters that were killing my file. So hard to find. But here is how you do it. In this example it is for the vmail_mailbox file, but this applies to just anything.

      tr -cd '\11\12\40-\176' < vmail_mailbox > vmail_mailbox_clean
      
      CCWTechC 1 Reply Last reply Reply Quote 1
      • CCWTechC
        CCWTech @scottalanmiller
        last edited by

        @scottalanmiller Great, but can you explain the syntax of the command?

        scottalanmillerS 1 Reply Last reply Reply Quote 0
        • scottalanmillerS
          scottalanmiller @CCWTech
          last edited by

          @CCWTech said in Clean a Linux or UNIX Text File to Strip Hidden Characters:

          @scottalanmiller Great, but can you explain the syntax of the command?

          trim anything accept characters 11, 12, or 40-176. The acceptable character ranges.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post