Answer by Sergiy Kolodyazhnyy for How to strip uncommon parts of filenames...
Perl solution We can use Perl to extract the wanted part before -201 substring, and store items into a hash, where each extracted string will be a key value. $ perl -ne...
View ArticleAnswer by heemayl for How to strip uncommon parts of filenames and have the...
Considering any possible filename, from that directory: printf '%s\0' cpu-*-201* | \ awk -F'-' 'BEGIN{RS="\0"} $3~/^201/ {a[$1"-"$2]} END{for(i in a) print i}' printf '%s\0' cpu-*-201* prints the...
View ArticleAnswer by steeldriver for How to strip uncommon parts of filenames and have...
I won't say this is "the optimal solution", but given $ ls cpu* cpu-interrupt-2016-05-07 cpu-softirq-2017-05-06 cpu-softirq-2017-05-08 cpu-system-2017-05-08 cpu-wait-2017-05-07 cpu-interrupt-2017-05-08...
View ArticleHow to strip uncommon parts of filenames and have the unique parts
Here is the file names I have; cpu-system-2016-05-06 cpu-system-2017-05-08 cpu-wait-2017-05-08 cpu-wait-2016-05-06 cpu-wait-2017-05-07 cpu-interrupt-2017-05-08 cpu-interrupt-2016-05-07...
View Article
More Pages to Explore .....