[Digikam-users] Not completely but a bit off topic question: looking for texteditor with macro capabillity

Johnny yggdrasil at gmx.co.uk
Sat Aug 27 21:25:42 BST 2011


sleepless <sleeplessregulus at hetnet.nl> writes:

> Thanks a lot for all responses, that helps a lot to get me going.
> Emacs looks great, I just have to learn all new keystrokes, and the
> batch script language, I will have to learn again also.
> And for the tip on the spreadsheet, I canĀ“t believe that I never have
> thought about that, very usefull.

I missed the start of the thread, here's my 2p. Or make it 3, as firstly
the spreadsheet is tentatively doable, but I would not encourage it for
this type of task, unless you are already a savvy spreadsheet user and
not interested / have no time to learn the right tools for the job.

Benjamin gave a good introduction to bash scripting, something which
you'll inevitably learn while tinkering in Linux. The method of looping
over file names and doing somthing is versatile and many times useful as
you can do whatever necessary in the situation, I always keep a template
around to build upon. Sed and Awk are your friends for string parsing!

Learning emacs is a great investment, but it requires time and
patience. Do /not/ configure it to be "Windows like" by changing
key-bindings - learning the defaults pay off in the long run. There's a
built in tutorial (press control and h followed by t, 'C-h t' in lingua
emacs). After this you'll be on your way to emacs mastery, but remember
to be patient. For moving files around, you'd like to look at
'dired'. Use 'C-h i' to bring up an info buffer and then press 'h' again
for a tutorial on info, and then use your newly acquired skills to
navigate to the 'dired' node to learn more about dired. For the 'macro
capability' you may want to look at the keybindings 'C-x (', 'C-x )' and
'C-x e'.

However, the most efficient way to do what you want to move certain
files around is arguably to use 'find' in a bash terminal. Just open up
a terminal, then to copy all files with a .jpg suffix from
/dir/to/search/ to /dir/to/copy/to/ do:

,----
| find /dir/to/search/ -maxdepth 1 -type f -iregex .*\.jpg$ -exec cp {} /dir/to/copy/to/ \;
`----

If you want to move the files, change 'cp' to 'mv'.

If you have photos in subfolders as well that you want to move, just
increase maxdepth to the desired subfolder level to search.

Regards,
-- 
Johnny



More information about the Digikam-users mailing list