(12-21-2022, 05:21 PM)dikembe Wrote: How is this problem dealt with normally?
As Snoopy wrote, you should make some sort of script.
You could possibly use something like this linux bash script, but python may be a faster choice:
Code:
#!/bin/bash
mapfile -t source < $1
mapfile -t potfile < $2
for i in "${!source[@]}"
do
for x in "${!potfile[@]}"
do
hash1=`echo "${source[$i]}" | cut -d":" -f2`
hash2=`echo "${potfile[$x]}" | cut -d":" -f1`
if [ "$hash1" == "$hash2" ]
then
if [ "$hash1" != "" ]
then
plain=`echo "${potfile[$x]}" | cut -d":" -f2-`
printf "${source[$i]}:$plain\n"
break
fi
fi
done
done
This script would be executed like
Quote:./concat.sh sourcefile potfile > concat.txt