|
|
? Terminal command for listing groups of files...
|
|
|
|
Mac Enthusiast
Join Date: Apr 2001
Location: ~
Status:
Offline
|
|
Hi ho,
Is there a command for the osX terminal - bash - that will list sequentially numbered groups of file as one line instead of individually, while listing other files and directories correctly?
Meaning that a group of files:
image.001.tif
image.002.tif
image.003.tif
image.004.tif
image.005.tif
would be listed as
image.001-005.tif
and a dir with other files and dirs:
image.001.tif
image.002.tif
image.003.tif
image.004.tif
image.005.tif
dir01/
dir02/
imageB.tif
in it would be:
image.001-005.tif
dir01/
dir02/
imageB.tif
?
Wold love to have this...
Thanks,
KM
|
kent m is not a member of any public groups
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Mar 2004
Status:
Offline
|
|
A command? Well, certainly no standard bash command (AFAIK).
But someone may have written such a script/tool. That's what it
would take I think. (And none too trivial either).
Well, the folder part would be easy. Not sure how to attack the
file-ranges portion. (You just need someone smarter than me!).
That shouldn't be too hard to find.
At any rate, it'll take some scripting.
|
-HI-
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Apr 2001
Location: ~
Status:
Offline
|
|
Yeah, a company I used to work for had a cmd on linux that would do this - very very useful - and I hopefully can dig it up. I thought I'd try here though - never realized it would be so unique.
|
kent m is not a member of any public groups
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Sep 2005
Location: Canada... be nice, eh?
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Mar 2004
Status:
Offline
|
|
Almost certainly it will be written in Perl
(which is about as legible as shorthand).
|
-HI-
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Apr 2001
Location: ~
Status:
Offline
|
|
Thanks very much for the input. If I get ahold of something that isn't proprietary I'll post it back here. I had no idea that this would be such a hard thing to find!
best,
K
|
kent m is not a member of any public groups
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Jan 2007
Status:
Offline
|
|
have you tried using sed and awk?
something like
ls ./*.tiff|sed 'y/./ /'|awk '{print $2}'
just put it in a variable get first output lastoutput and print string $1 .firstinput-lastoutput.tif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|