| Post Reply | RetroFed Forum Forum Index » Fish |
| Author | Message | ||
|---|---|---|---|
takeheart
lemmy.world
takeheart@lemmy.worldJoined: 2023-07-08 |
I'm writing a fish script to process the output of music tagging programs (like operon). I use this for instance to list the filenames of all music tracks in a collection that are missing certain tags like a date of release or which have a CD number tag but no tracknumber tag. Unfortunately the output I'm parsing may control control characters // escape sequences. This caused me quite a lot of headache during debugging. Take the following string for instance: it will display as
As you can see it starts with a terminal escape sequence which is rendered as a whitespace. Is there an easy way to strip any and all escape sequences from a variable? I used regular expression search and replace with some success, but that seems quite a brittle approach as I can't anticipate every single (edge) case and could also accidentally remove stuff I want to keep. |
||
| 2 Original | |||
| Post Reply |
Back to top |