[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Creating directory with partial filename
From: |
Ole Tange |
Subject: |
Re: Creating directory with partial filename |
Date: |
Sun, 16 Jun 2013 02:09:38 +0200 |
On Mon, Jun 3, 2013 at 9:52 PM, Tyler Thorsted <t.thorsted@ldschurch.org> wrote:
> 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.
:
> 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
Process the files in the same dir and then run:
ls | grep jpg | rename '/(.*)(.{6})/; mkdir $1; $_="$1/$_"'
/Ole