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

    Solved File Management removing unprintable characters

    IT Discussion
    users file management unprintable file system archiving
    8
    47
    3.7k
    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.
    • DustinB3403D
      DustinB3403 @1337
      last edited by

      @Pete-S said in File Management removing unprintable characters:

      Expect some support calls when you rename customer files and they can't open them using "recent files".

      Not my concern in the least

      @Pete-S said in File Management removing unprintable characters:

      Also expect problems when you rename a file that someone has open. Normally you can't => script fail.

      Only targeting files that are marked for "archive" - so not an issue

      @Pete-S said in File Management removing unprintable characters:

      Also expect problem if someone makes a new file with the original name. Now there will be two files that will have the same name after the renaming process => script fail.

      We already punch people in the back of the head for this

      @Pete-S said in File Management removing unprintable characters:

      Also hope that there aren't any application files that will not pass the regex => application fail.

      Nope

      @Pete-S said in File Management removing unprintable characters:

      Is the backup something homemade or something very old perhaps?

      Using B2 CLI to move stuff, so not old at all.

      1 1 Reply Last reply Reply Quote 0
      • DashrenderD
        Dashrender
        last edited by

        This really sounds like an HR problem that you're kinda solving with tech. If it's not against company policy to use those characters in file names/paths - then what you wanting to do is likely the wrong approach... and instead management should be approving you to find a new backup solution that works with those filenames.

        DustinB3403D 1 Reply Last reply Reply Quote 0
        • DustinB3403D
          DustinB3403 @Dashrender
          last edited by

          @Dashrender said in File Management removing unprintable characters:

          This really sounds like an HR problem that you're kinda solving with tech. If it's not against company policy to use those characters in file names/paths - then what you wanting to do is likely the wrong approach... and instead management should be approving you to find a new backup solution that works with those filenames.

          There is no policy on this, not would there be one.

          This is an insane way to think about that.

          DashrenderD scottalanmillerS 2 Replies Last reply Reply Quote 0
          • DustinB3403D
            DustinB3403
            last edited by

            Okay so with a bit more offline assistance from @Obsolesce

            This is what works

            (Get-ChildItem -Path "some\path" -Recurse | Rename-Item -NewName {$_.Name -replace '•','-'} -verbose)

            Obviously it's only hitting on that bullet point, and replacing it with a hyphen, but that's better than the operation failing over and over and not ever knowing it.

            ObsolesceO 1 Reply Last reply Reply Quote 0
            • ObsolesceO
              Obsolesce @DustinB3403
              last edited by

              @DustinB3403 said in File Management removing unprintable characters:

              Okay so with a bit more offline assistance from @Obsolesce

              This is what works

              (Get-ChildItem -Path "some\path" -Recurse | Rename-Item -NewName {$_.Name -replace '•','-'} -verbose)

              Obviously it's only hitting on that bullet point, and replacing it with a hyphen, but that's better than the operation failing over and over and not ever knowing it.

              If you want to know if there's an error, you can build that in like this:

              
              (Get-ChildItem -Path "C:\test" -Recurse | Rename-Item -NewName {$_.Name -replace '[^\p{L}\p{Nd}\p{P}]','-'} -WhatIf -ErrorAction SilentlyContinue -ErrorVariable daError)
              if ($daError) {
                  Write-Output "ERROR - There was an error. Pay attention : [$daError]"
              }
              
              
              1 Reply Last reply Reply Quote 0
              • DashrenderD
                Dashrender @DustinB3403
                last edited by

                @DustinB3403 said in File Management removing unprintable characters:

                @Dashrender said in File Management removing unprintable characters:

                This really sounds like an HR problem that you're kinda solving with tech. If it's not against company policy to use those characters in file names/paths - then what you wanting to do is likely the wrong approach... and instead management should be approving you to find a new backup solution that works with those filenames.

                There is no policy on this, not would there be one.

                This is an insane way to think about that.

                See, you wanting to change the way users work to suit IT is generally something @scottalanmiller would say is likely wrong for the business.

                1 Reply Last reply Reply Quote 2
                • 1
                  1337 @DustinB3403
                  last edited by 1337

                  @DustinB3403 said in File Management removing unprintable characters:

                  @Pete-S said in File Management removing unprintable characters:
                  Is the backup something homemade or something very old perhaps?

                  Using B2 CLI to move stuff, so not old at all.

                  You have to realize that there are multi-national companies everywhere. So when you have problems with filenames, it's extremely unlikely that something modern will not support whatever it is you are doing - as long as the filename is valid on the OS you are using. And Backblaze of course supports all characters.

                  https://www.backblaze.com/b2/docs/string_encoding.html

                  Maybe there is a bug somewhere or maybe you are using it the wrong way. But this is the actual problem, not that users use whatever filename they want.

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

                    @DustinB3403 said in File Management removing unprintable characters:

                    @Dashrender said in File Management removing unprintable characters:

                    This really sounds like an HR problem that you're kinda solving with tech. If it's not against company policy to use those characters in file names/paths - then what you wanting to do is likely the wrong approach... and instead management should be approving you to find a new backup solution that works with those filenames.

                    There is no policy on this, not would there be one.

                    This is an insane way to think about that.

                    Well, let's back up. Why are people using those characters? Chances are they are real characters. They are getting in there somehow, and not likely from someone trying to be weird, but likely from an alternative keyboard or something.

                    DustinB3403D 1 Reply Last reply Reply Quote 0
                    • DustinB3403D
                      DustinB3403 @1337
                      last edited by

                      @Pete-S Using a bullet point in a damn folder or file name is not at all normal!

                      FFS.

                      If you think a file or folder named

                      • some crap

                      Is used globally, you're just wrong.

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

                        @scottalanmiller said in File Management removing unprintable characters:

                        @DustinB3403 said in File Management removing unprintable characters:

                        @Dashrender said in File Management removing unprintable characters:

                        This really sounds like an HR problem that you're kinda solving with tech. If it's not against company policy to use those characters in file names/paths - then what you wanting to do is likely the wrong approach... and instead management should be approving you to find a new backup solution that works with those filenames.

                        There is no policy on this, not would there be one.

                        This is an insane way to think about that.

                        Well, let's back up. Why are people using those characters? Chances are they are real characters. They are getting in there somehow, and not likely from someone trying to be weird, but likely from an alternative keyboard or something.

                        The reasoning as far as I've seen is it puts the content at the top of the list as the main culprit excuse. One which I'd rather not try to "fix" since it's well beyond my ability to hit these fools hard enough.

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

                          But a bullet point is printable and I bet some languages use it somewhere. But maybe it came from some odd cut and paste procedure. But something is causing this to happen, I assume that this isn't all one person?

                          DustinB3403D 2 Replies Last reply Reply Quote 0
                          • scottalanmillerS
                            scottalanmiller @DustinB3403
                            last edited by

                            @DustinB3403 said in File Management removing unprintable characters:

                            @scottalanmiller said in File Management removing unprintable characters:

                            @DustinB3403 said in File Management removing unprintable characters:

                            @Dashrender said in File Management removing unprintable characters:

                            This really sounds like an HR problem that you're kinda solving with tech. If it's not against company policy to use those characters in file names/paths - then what you wanting to do is likely the wrong approach... and instead management should be approving you to find a new backup solution that works with those filenames.

                            There is no policy on this, not would there be one.

                            This is an insane way to think about that.

                            Well, let's back up. Why are people using those characters? Chances are they are real characters. They are getting in there somehow, and not likely from someone trying to be weird, but likely from an alternative keyboard or something.

                            The reasoning as far as I've seen is it puts the content at the top of the list as the main culprit excuse. One which I'd rather not try to "fix" since it's well beyond my ability to hit these fools hard enough.

                            Well that definitely isn't a good reason if they are trying to use special characters as indexing data.

                            DashrenderD 1 Reply Last reply Reply Quote 0
                            • DustinB3403D
                              DustinB3403 @scottalanmiller
                              last edited by

                              @scottalanmiller said in File Management removing unprintable characters:

                              I assume that this isn't all one person?

                              Our staff are pulled onto so many projects that I wouldn't even have an idea of who or when something like a copy and paste issue occurred.

                              Is it possible, absolutely.

                              Is it also happening far too often, absolutely and thus I'll fix it when the files are closed via powershell.

                              @Obsolesce thanks for assisting with this.

                              1 Reply Last reply Reply Quote 0
                              • DustinB3403D
                                DustinB3403 @scottalanmiller
                                last edited by

                                @scottalanmiller said in File Management removing unprintable characters:

                                But a bullet point is printable and I bet some languages use it somewhere. But maybe it came from some odd cut and paste procedure. But something is causing this to happen, I assume that this isn't all one person?

                                It's not printable to B2 and causes failures. 🙂

                                Hence the point in finding a way to find and replace all bullet points in files and folders.

                                1 Reply Last reply Reply Quote 0
                                • DashrenderD
                                  Dashrender @scottalanmiller
                                  last edited by

                                  @scottalanmiller said in File Management removing unprintable characters:

                                  @DustinB3403 said in File Management removing unprintable characters:

                                  @scottalanmiller said in File Management removing unprintable characters:

                                  @DustinB3403 said in File Management removing unprintable characters:

                                  @Dashrender said in File Management removing unprintable characters:

                                  This really sounds like an HR problem that you're kinda solving with tech. If it's not against company policy to use those characters in file names/paths - then what you wanting to do is likely the wrong approach... and instead management should be approving you to find a new backup solution that works with those filenames.

                                  There is no policy on this, not would there be one.

                                  This is an insane way to think about that.

                                  Well, let's back up. Why are people using those characters? Chances are they are real characters. They are getting in there somehow, and not likely from someone trying to be weird, but likely from an alternative keyboard or something.

                                  The reasoning as far as I've seen is it puts the content at the top of the list as the main culprit excuse. One which I'd rather not try to "fix" since it's well beyond my ability to hit these fools hard enough.

                                  Well that definitely isn't a good reason if they are trying to use special characters as indexing data.

                                  LOL - I do this all the time.
                                  just not with non-traditional characters.

                                  ObsolesceO 1 Reply Last reply Reply Quote 0
                                  • ObsolesceO
                                    Obsolesce @Dashrender
                                    last edited by

                                    @Dashrender said in File Management removing unprintable characters:

                                    @scottalanmiller said in File Management removing unprintable characters:

                                    @DustinB3403 said in File Management removing unprintable characters:

                                    @scottalanmiller said in File Management removing unprintable characters:

                                    @DustinB3403 said in File Management removing unprintable characters:

                                    @Dashrender said in File Management removing unprintable characters:

                                    This really sounds like an HR problem that you're kinda solving with tech. If it's not against company policy to use those characters in file names/paths - then what you wanting to do is likely the wrong approach... and instead management should be approving you to find a new backup solution that works with those filenames.

                                    There is no policy on this, not would there be one.

                                    This is an insane way to think about that.

                                    Well, let's back up. Why are people using those characters? Chances are they are real characters. They are getting in there somehow, and not likely from someone trying to be weird, but likely from an alternative keyboard or something.

                                    The reasoning as far as I've seen is it puts the content at the top of the list as the main culprit excuse. One which I'd rather not try to "fix" since it's well beyond my ability to hit these fools hard enough.

                                    Well that definitely isn't a good reason if they are trying to use special characters as indexing data.

                                    LOL - I do this all the time.
                                    just not with non-traditional characters.

                                    Usually underscores or exclamation marks right?

                                    DashrenderD 1 Reply Last reply Reply Quote 0
                                    • DashrenderD
                                      Dashrender @Obsolesce
                                      last edited by

                                      @Obsolesce said in File Management removing unprintable characters:

                                      @Dashrender said in File Management removing unprintable characters:

                                      @scottalanmiller said in File Management removing unprintable characters:

                                      @DustinB3403 said in File Management removing unprintable characters:

                                      @scottalanmiller said in File Management removing unprintable characters:

                                      @DustinB3403 said in File Management removing unprintable characters:

                                      @Dashrender said in File Management removing unprintable characters:

                                      This really sounds like an HR problem that you're kinda solving with tech. If it's not against company policy to use those characters in file names/paths - then what you wanting to do is likely the wrong approach... and instead management should be approving you to find a new backup solution that works with those filenames.

                                      There is no policy on this, not would there be one.

                                      This is an insane way to think about that.

                                      Well, let's back up. Why are people using those characters? Chances are they are real characters. They are getting in there somehow, and not likely from someone trying to be weird, but likely from an alternative keyboard or something.

                                      The reasoning as far as I've seen is it puts the content at the top of the list as the main culprit excuse. One which I'd rather not try to "fix" since it's well beyond my ability to hit these fools hard enough.

                                      Well that definitely isn't a good reason if they are trying to use special characters as indexing data.

                                      LOL - I do this all the time.
                                      just not with non-traditional characters.

                                      Usually underscores or exclamation marks right?

                                      I had no idea punctuation would be before characters, so no.. I normally do aaa or 111 or some stupid shit.

                                      1 Reply Last reply Reply Quote 0
                                      • DustinB3403D
                                        DustinB3403
                                        last edited by

                                        And of course just found another user who is using some other bullet point that I have no clue of to the type. . .

                                        come on people. . .

                                        1 Reply Last reply Reply Quote 0
                                        • 1
                                          1337
                                          last edited by

                                          This post is deleted!
                                          1 Reply Last reply Reply Quote 0
                                          • DustinB3403D
                                            DustinB3403
                                            last edited by

                                            As a followup to this, found other special characters that are being used in some files. . . ™. . .

                                            Yeah thank you whoever uses ™ in a damn file name!

                                            scottalanmillerS 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 2 / 3
                                            • First post
                                              Last post