home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.linux      Getting to be as bloated as Windows!      107,822 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 106,016 of 107,822   
   Java Jive to Java Jive   
   Re: Specifying an action to copy a file    
   30 Mar 24 11:20:47   
   
   XPost: uk.comp.os.linux   
   From: java@evij.com.invalid   
      
   On 30/03/2024 01:04, Java Jive wrote:   
   >   
   > 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've solved this part now as well.  The following command does it   
   (originally all one line):   
      
   find 'Family History/_all' -name "*.png" | sort | sed -E '{ h;   
   s~/_all/[1-5][ont]{1,2}~~ ; s~ +\([ont]{1,2}\)~~ ; G ; s/\n/\t/ }' |   
   sort | sed 's/^[^\t]\+\t//' > 'Family History/_all/FHBlinkList.txt'   
      
   The most complex part is the first sed command, so I will explain it:   
      
   h	Copy input, the original full pathname, to the hold space   
   s 2x	Remove the '/_all/*' and ' (*)' parts of the pathname   
   G	Retrieve and append the original line from the hold space   
   s	Replace the intervening new line character with a tab   
      
   The second sed command removes the first part of the line up to and   
   including the tab which was used as a key in the final sort immediately   
   previously.   
      
   However, although the problems as originally stated are now both solved,   
   I need to do this second stage better, as I need to exclude from the   
   list those files that already have a chosen final copy in the main part   
   of the archive.   
      
   >> 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   
      
   --   
      
   Fake news kills!   
      
   I may be contacted via the contact address given on my website:   
   www.macfh.co.uk   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca