Tue 15 Jul 2014 10:01:27 AM UTC, comment #6:
With the new {= perlexpr =} feature you can get the extension like this:
parallel --rpl '{..} s/.*\.//' echo {..} ::: foo.gif
You should feel free to put the --rpl '{..} s/.*\.//' in a profile - possibly your default profile, so that it will always be available to you.
|
Wed 04 Jun 2014 12:59:46 PM UTC, comment #4:
GNU Parallel does not need to know how many jobs to run before starting the first. This is a feature, not a bug.
--equal-width would require GNU Parallel to first find out how many jobs before knowing how many 0's to prepend.
I probably need to see important use cases before this will happen.
|
Wed 04 Jun 2014 04:06:05 AM UTC, comment #3:
More general syntax is a great idea, although I can't think of any established convention.
A relevant note: it will be great if {#} has an equal width version like `-w/--equal-width' for `seq' (then inline batch renaming will be super easy, saving a `printf' and nasty quoting issues associated with it). However, the usage of this might be very limited.
|
Fri 30 May 2014 08:43:53 PM UTC, original submission:
We already have
+verbatim
{} Input line.
{.} Input line without extension.
{/} Basename of input line.
{//} Dirname of input line.
{/.} Basename of input line without extension.
-verbatim
That is to say, if we label dirname with 1, basename without extension with 2, extension with 3, then we already have 123, 12, 23, 1, 2.
Therefore, it might be a good idea to add a replacement string, possibly {..}, for extension.
To give you an idea of why this could be useful, I do batch image processing frequently, for which I rename the images yet preserve the extensions (.jpg, .png, .gif, .tiff, etc.). Extracting the extension is as simple as an awk, but I do it frequently enough so it will be nice to have a replacement string out of box.
|