Something
public shellscript v1 · immutablefilelength=wc -l array.txtfor ((i=1;i<=filelength;i+=1)) do if [ sed -n '$i/<key>.*<\/key>/p' array.txt ] for ((j=i;j<=filelength;j+=1)); do if [ sed -n '$i /<string>.*<\/string>/p' array.txt ] then # insert code that will take key and string and insert them into an array fi done fidone