As some here may recall, I'm in the midst of several years' work
scanning family documents, post-processing them, and then releasing them either to the general public for generations sufficiently removed from living people, or else just back to the source branch of the family. Currently there are nearly 15,000 original documents with equal numbers
of post-processed versions arranged as below, but around 7,000 of them completed in previous stages already have final documents, so there are around 8,000 newly added documents left to do. What I need to do is use
a program, feh seems a likely choice, to work through those documents
that don't yet have a final version, choose one from five possible
versions described below, copy it to its corresponding final directory,
and move on to the next.
The documents are arranged as follows:
Family History
/_all/1o/subs Original scans
/_all/2n/subs Normalised versions of the originals
/_all/3t/subs Textcleaned versions ditto
/_all/4nt/subs Normalised then textcleaned versions ditto
/_all/5tn/subs Textcleaned then normalised versions ditto
/subs Final docs chosen from the best of the above
Example for one particular subdirectory:
Family History/_all/1o/Alston
Family History/_all/2n/Alston
Family History/_all/3t/Alston
Family History/_all/4nt/Alston
Family History/_all/5tn/Alston
Family History/Alston
I've tried the following command line for feh (sorry can't help any line wrap):
user@computer:~# feh -Fdr -A 'echo cp -a \"%F\" \"$(echo %F | sed -E "{ s~/_all/[1-5][ont]{1,2}~~ ; s~ +\([ont]{1,2}\)~~ }" )\"' 'Family History/_all/1o'
.... which results in ...
cp -a "Family History/_all/1o/Alston/Alston Descent - 2nd Earl Of
Montrose, William - 1 (o).png" "Family History/Alston/Alston Descent -
2nd Earl Of Montrose, William - 1.png"
.... which looks as though it should do the job, however removing the
echo ...
user@computer:~# feh -Fdr -A 'cp -a \"%F\" \"$(echo %F | sed -E "{ s~/_all/[1-5][ont]{1,2}~~ ; s~ +\([ont]{1,2}\)~~ }" )\"' 'Family History/_all/1o'
.... results in ...
cp: target '1.png"' is not a directory
Can anyone suggest a magical incantation which will yield the desired result?
Another problem is that I'm going to have order the files so that each
of the 5 possible versions are displayed successively so that I can use
the arrow keys to go back and forth between them to choose the best. I think I might be able to use a file list to do this, but as yet I
haven't given much thought as to how to create it, it would have to be
of the form:
Family History/_all/1o/Alston/Document 1 (o).png
Family History/_all/2n/Alston/Document 1 (n).png
Family History/_all/3t/Alston/Document 1 (t).png
Family History/_all/4nt/Alston/Document 1 (nt).png
Family History/_all/5tn/Alston/Document 1 (tn).png
Family History/_all/1o/Alston/Document 2 (o).png
Family History/_all/2n/Alston/Document 2 (n).png
Family History/_all/3t/Alston/Document 2 (t).png
Family History/_all/4nt/Alston/Document 2 (nt).png
Family History/_all/5tn/Alston/Document 2 (tn).png
etc.
I could also use Windows if there's a better solution available there,
but that seems unlikely to me.
Any help gratefully received.
First problem solved ...
On 29/03/2024 22:54, Java Jive wrote:
Another problem is that I'm going to have order the files so that each
of the 5 possible versions are displayed successively so that I can
use the arrow keys to go back and forth between them to choose the
best. I think I might be able to use a file list to do this, but as
yet I haven't given much thought as to how to create it, it would have
to be of the form:
Family History/_all/1o/Alston/Document 1 (o).png
Family History/_all/2n/Alston/Document 1 (n).png
Family History/_all/3t/Alston/Document 1 (t).png
Family History/_all/4nt/Alston/Document 1 (nt).png
Family History/_all/5tn/Alston/Document 1 (tn).png
Family History/_all/1o/Alston/Document 2 (o).png
Family History/_all/2n/Alston/Document 2 (n).png
Family History/_all/3t/Alston/Document 2 (t).png
Family History/_all/4nt/Alston/Document 2 (nt).png
Family History/_all/5tn/Alston/Document 2 (tn).png
etc.
I could also use Windows if there's a better solution available there,
but that seems unlikely to me.
Still to do.
Any help gratefully received.
Stet
I've tried the following command line for feh (sorry can't help any line wrap):
user@computer:~# feh -Fdr -A 'echo cp -a \"%F\" \"$(echo %F | sed -E "{ s~/_all/[1-5][ont]{1,2}~~ ; s~ +\([ont]{1,2}\)~~ }" )\"' 'Family History/_all/1o'
On 2024-03-29 23:54, Java Jive wrote:
I've tried the following command line for feh (sorry can't help any
line wrap):
user@computer:~# feh -Fdr -A 'echo cp -a \"%F\" \"$(echo %F | sed -E
"{ s~/_all/[1-5][ont]{1,2}~~ ; s~ +\([ont]{1,2}\)~~ }" )\"' 'Family
History/_all/1o'
There is an addon for Thunderbird that allows writing long lines.
Unfortunately, it applies to the entire post or email, not to paragraphs.
As some here may recall, I'm in the midst of several years' work scanning family documents, post-processing them, and then releasing them either to the general public for generations sufficiently removed from living people, or else just back to the source branch of the family. Currently there are nearly 15,000 original documents with equal numbers of post-processed versions arranged as below, but around 7,000 of them completed in previous stages already have final documents, so there are around 8,000 newly added documents left to do. What I need to do is use a program, feh seems a likely choice, to work through those documents that don't yet have a final version, choose one from five possible versions described below, copy it to its corresponding final directory, and move on to the next.
The documents are arranged as follows:
Family History
/_all/1o/subs Original scans
/_all/2n/subs Normalised versions of the originals /_all/3t/subs Textcleaned versions ditto /_all/4nt/subs Normalised then textcleaned versions ditto /_all/5tn/subs Textcleaned then normalised versions ditto /subs Final docs chosen from the best of the above
Example for one particular subdirectory:
Family History/_all/1o/Alston
Family History/_all/2n/Alston
Family History/_all/3t/Alston
Family History/_all/4nt/Alston
Family History/_all/5tn/Alston
Family History/Alston
I've tried the following command line for feh (sorry can't help any line wrap):
user@computer:~# feh -Fdr -A 'echo cp -a \"%F\" \"$(echo %F | sed -E "{ s~/_all/[1-5][ont]{1,2}~~ ; s~ +\([ont]{1,2}\)~~ }" )\"' 'Family History/_all/1o'
... which results in ...
cp -a "Family History/_all/1o/Alston/Alston Descent - 2nd Earl Of Montrose, William - 1 (o).png" "Family History/Alston/Alston Descent - 2nd Earl Of Montrose, William - 1.png"
... which looks as though it should do the job, however removing the echo ...
user@computer:~# feh -Fdr -A 'cp -a \"%F\" \"$(echo %F | sed -E "{ s~/_all/[1-5][ont]{1,2}~~ ; s~ +\([ont]{1,2}\)~~ }" )\"' 'Family History/_all/1o'
... results in ...
cp: target '1.png"' is not a directory
Can anyone suggest a magical incantation which will yield the desired result?
Another problem is that I'm going to have order the files so that each of the 5 possible versions are displayed successively so that I can use the arrow keys to go back and forth between them to choose the best. I think I might be able to use a file list to do this, but as yet I haven't given much thought as to how to create it, it would have to be of the form:
Family History/_all/1o/Alston/Document 1 (o).png
Family History/_all/2n/Alston/Document 1 (n).png
Family History/_all/3t/Alston/Document 1 (t).png
Family History/_all/4nt/Alston/Document 1 (nt).png
Family History/_all/5tn/Alston/Document 1 (tn).png
Family History/_all/1o/Alston/Document 2 (o).png
Family History/_all/2n/Alston/Document 2 (n).png
Family History/_all/3t/Alston/Document 2 (t).png
Family History/_all/4nt/Alston/Document 2 (nt).png
Family History/_all/5tn/Alston/Document 2 (tn).png
etc.
I could also use Windows if there's a better solution available there, but that seems unlikely to me.
Any help gratefully received.
On 3/29/2024 6:54 PM, Java Jive wrote:
As some here may recall, I'm in the midst of several years' work scanning family documents, post-processing them, and then releasing them either to the general public for generations sufficiently removed from living people, or else just back to the source branch of the family. Currently there are nearly 15,000 original documents with equal numbers of post-processed versions arranged as below, but around 7,000 of them completed in previous stages already have final documents, so there are around 8,000 newly added documents left to do. What I need to do is use a program, feh seems a likely choice, to work through those documents that don't yet have a final version, choose one from five possible versions described below, copy it to its corresponding final directory, and move on to the next.
The documents are arranged as follows:
Family History
/_all/1o/subs Original scans
/_all/2n/subs Normalised versions of the originals
/_all/3t/subs Textcleaned versions ditto
/_all/4nt/subs Normalised then textcleaned versions ditto
/_all/5tn/subs Textcleaned then normalised versions ditto
/subs Final docs chosen from the best of the above
Example for one particular subdirectory:
Family History/_all/1o/Alston
Family History/_all/2n/Alston
Family History/_all/3t/Alston
Family History/_all/4nt/Alston
Family History/_all/5tn/Alston
Family History/Alston
I've tried the following command line for feh (sorry can't help any line wrap):
user@computer:~# feh -Fdr -A 'echo cp -a \"%F\" \"$(echo %F | sed -E "{ s~/_all/[1-5][ont]{1,2}~~ ; s~ +\([ont]{1,2}\)~~ }" )\"' 'Family History/_all/1o'
... which results in ...
cp -a "Family History/_all/1o/Alston/Alston Descent - 2nd Earl Of Montrose, William - 1 (o).png" "Family History/Alston/Alston Descent - 2nd Earl Of Montrose, William - 1.png"
... which looks as though it should do the job, however removing the echo ...
user@computer:~# feh -Fdr -A 'cp -a \"%F\" \"$(echo %F | sed -E "{ s~/_all/[1-5][ont]{1,2}~~ ; s~ +\([ont]{1,2}\)~~ }" )\"' 'Family History/_all/1o'
... results in ...
cp: target '1.png"' is not a directory
Can anyone suggest a magical incantation which will yield the desired result?
Another problem is that I'm going to have order the files so that each of the 5 possible versions are displayed successively so that I can use the arrow keys to go back and forth between them to choose the best. I think I might be able to use a file list to do this, but as yet I haven't given much thought as to how to create it, it would have to be of the form:
Family History/_all/1o/Alston/Document 1 (o).png
Family History/_all/2n/Alston/Document 1 (n).png
Family History/_all/3t/Alston/Document 1 (t).png
Family History/_all/4nt/Alston/Document 1 (nt).png
Family History/_all/5tn/Alston/Document 1 (tn).png
Family History/_all/1o/Alston/Document 2 (o).png
Family History/_all/2n/Alston/Document 2 (n).png
Family History/_all/3t/Alston/Document 2 (t).png
Family History/_all/4nt/Alston/Document 2 (nt).png
Family History/_all/5tn/Alston/Document 2 (tn).png
etc.
I could also use Windows if there's a better solution available there, but that seems unlikely to me.
Any help gratefully received.
If cp had a --dry-run, you could obtain what it sees that way.
When it doesn't have such an option, you can debug another way.
Make yourself a "dumper" to dump the parameters seen on the command line.
You can put "dumper" in place of "cp" and get the parameters that way.
gcc -o dumper dumper.c
#include<stdio.h>
int main(int argc, char *argv[])
{
int i;
printf("Number of arguments = %d\n", argc-1);
for(i=0; i<argc; i++)
{
if (i == 0) {
printf("Program name = %s\n", argv[i]);
} else {
printf("%s\n",argv[i]);
}
}
}
$ ./dumper
Number of arguments = 0
Program name = dumper
$ ./dumper a b c
Number of arguments = 3
Program name = dumper
a
b
c
Your problem will likely involve "escaping" and "how many
levels of shells, subshells, and interpreting are going on".
You know the drill by now :-) It is the "land of the
random number of backslashes" :-)
Echo is both a built-in for the bash shell, as well
as a /usr/bin/echo existing (maybe some other shell
might need it).
By inspection, I don't understand why your command
is failing, but shine a flashlight on it and
see if you can figure it out. The usage of "dumper"
should have the same "nested shell count" as using "cp",
that's my hope.
Sysop: | Luis Silva |
---|---|
Location: | Lisbon |
Users: | 763 |
Nodes: | 10 (0 / 10) |
Uptime: | 180:05:32 |
Calls: | 111 |
Files: | 46,971 |
Messages: | 11,239 |