I wrote the following while loop
while IFS= read -r uid; do echo "$uid" >> output_file esearch -db nuccore -query "$uid" | elink -ta