Data wrangler, software engineer, systems programmer, cyclist. Unix (mostly Solaris) for aeons. I talk C, Python, SQL, Performance, Java, Kafka and Makefiles.
Location
Brisbane, Australia
Education
BA (Mathematics, Modern History), University of Queensland
This is the sort of relatively simple use-case that I'd just use a shell kinda-one-liner for. Admittedly, I've done thousands of these over the years (ripping CDs to flac and renaming etc) but shell is what comes to me first for this.
Something along the lines of
$ LIST=`find * -name \*pdf`;
$ for f in $LIST; do \
N=`echo $f|sed -e"s, ,,g;s,(,_;s,),,g"`; \
mv "$f" $N; done
You'd need to match that up with your preferred directory hierarchy and nomenclature; my bias is against spaces and suchlike in filenames so I remove and replace with - and _ depending on what I wish to make clear.
The great thing, though, is that the problem space here is simple enough that there are several different ways to solve it, each of which allow us to use our favourite language. But - please! - don't try doing regex in C!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is the sort of relatively simple use-case that I'd just use a shell kinda-one-liner for. Admittedly, I've done thousands of these over the years (ripping CDs to flac and renaming etc) but shell is what comes to me first for this.
Something along the lines of
You'd need to match that up with your preferred directory hierarchy and nomenclature; my bias is against spaces and suchlike in filenames so I remove and replace with - and _ depending on what I wish to make clear.
The great thing, though, is that the problem space here is simple enough that there are several different ways to solve it, each of which allow us to use our favourite language. But - please! - don't try doing regex in C!