[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 11:40:12 +0200 |
On Sun, Jun 16, 2013 at 2:09 AM, Ole Tange <ole@tange.dk> wrote:
> On Mon, Jun 3, 2013 at 9:52 PM, Tyler Thorsted <t.thorsted@ldschurch.org>
> wrote:
:
>> 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/$_"'
If you use BASH this would also work:
parallel 'A={};B=${A/%??????????/}; mkdir -p $B; convert {}
$B/{.}.jpg' ::: *.tif
/Ole