Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • I'm running into a problem in that some filenames have a premature dash (-) resulting in too much information being trimmed. Is there a way to dictate removing the last 14 characters of the file? This would avoid any over trimming of filenames with an early dash (-) Commented Mar 12, 2017 at 13:06
  • @Frank in that case, you need another way to distinguish the part you do want from the part you don't. Is the part you want to trim always the first number, or the first number of a specific length? Commented Mar 12, 2017 at 13:08
  • Every file has a 14 character suffix. Commented Mar 12, 2017 at 13:10
  • @Frank answer edited Commented Mar 12, 2017 at 13:11
  • some file-170227-222746.png - so every file ends with 14 characters prior to the .png - if there were a command to remove exactly 14 characters (the -170227-222746 section) from the end of the file not counting the .png that would work flawlessly. To result in - some file.png Commented Mar 12, 2017 at 13:16