It's time to declare the winners and mark this thread SOLVED.
These are the solutions with the shortest execution times.
This code ...
Code:
InFile='/usr/share/dict/words'
RW='etaoinshrldu' # RW = Reference Word
echo "There are "$(wc -l <$InFile)" words in the InFile."
echo
echo '========================================================================='
echo 'Identify letters in each InFile word which are not in the Reference Word.'
echo '========================================================================='
echo; echo 'Method #1 of LQ Member danielbmartin.'
echo 'Reference Word = '$RW
time tr -d "[$RW]" <$InFile |paste -d' ' $InFile - >$OutFileA
echo
echo '========================================================================='
echo 'Now address the mirror-image problem....'
echo 'Identify letters in the Reference Word which are not in each InFile word.'
echo '========================================================================='
echo; echo 'Method #6.2 of LQ Member danielbmartin'
echo ' using INDEX and MAWK as suggested by shruggy.'
echo 'Reference Word = '$RW
time mawk -v rw=$RW 'BEGIN{n=split(rw,a,"")}
{NoMatch=""
for (j=1;j<=n;j++)
if (!index($0,a[j])) NoMatch=NoMatch a[j]
print $0,NoMatch}' $InFile >$OutFileG
echo; echo "Normal end of job."; echo; exit
... produced this result ...
Code:
There are 99171 words in the InFile.
=========================================================================
Identify letters in each InFile word which are not in the Reference Word.
=========================================================================
Method #1 of LQ Member danielbmartin.
Reference Word = etaoinshrldu
real 0m0.012s
user 0m0.008s
sys 0m0.004s
=========================================================================
Now address the mirror-image problem....
Identify letters in the Reference Word which are not in each InFile word.
=========================================================================
Method #6.2 of LQ Member danielbmartin
using INDEX and MAWK as suggested by shruggy.
Reference Word = etaoinshrldu
real 0m0.208s
user 0m0.204s
sys 0m0.000s
Normal end of job.
Daniel B. Martin
.