parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating directory with partial filename


From: Shlomi Fish
Subject: Re: Creating directory with partial filename
Date: Tue, 4 Jun 2013 10:48:18 +0300

Hi Mr. Thorsted,

On Mon, 3 Jun 2013 19:52:01 +0000
Tyler Thorsted <t.thorsted@ldschurch.org> wrote:

> Hello,
> 
> I am new to parallel and didn't see in the manual a way to use a portion of a
> filename in creating a folder to move files into after processing.
> 
> I am using ImageMagick to convert images to another format and my naming
> convention for files is static up until the last 6 characters, which are
> unique to each image.
> 
> I would like to create a directory via the script to create a folder with the
> static portion of the filename and process all the images with that static
> portion to the that folder.
> 
> ie.
> 
> M1234_b0000_f0001_00001.tif
> M1234_b0000_f0001_00002.tif
> M1234_b0000_f0001_00003.tif
> M1234_b0000_f0001_00004.tif
> 
> all jpg images would process to a directory named M1234_b0000_f0001
> and
> 
> M1234_b0000_f0002_00001.tif
> M1234_b0000_f0002_00002.tif
> M1234_b0000_f0002_00003.tif
> M1234_b0000_f0002_00004.tif
> 
> all jpg images would process to M1234_b0000_f0002
> 
> I have used the regex "s/.\{6\}$//" in other scripts to get the folder name,
> but how do I use it in parallel.

I suggest you code a short script in shell, Perl, Python or whatever and use
parallel to call it, and this script will do the transformation you want with
its input and emit the result.

This is how I call parallel:

https://bitbucket.org/shlomif/black-hole-solitaire/src/fbc25e17627bd37a9756881fce7a5fe23f825c60/black-hole-solitaire/all-in-a-row-gnu-parallel-range-solving/range-solving.bash?at=default

(short URL - http://is.gd/8JGPst ).

Regards,

        Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Understand what Open Source is - http://shlom.in/oss-fs

When Chuck Norris uses git, he takes a coffee break after initiating every git
commit. And then he waits for the commit to finish.
    — http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/

Please reply to list if it's a mailing list post - http://shlom.in/reply .



reply via email to

[Prev in Thread] Current Thread [Next in Thread]