Your question is a little unclear, but in order to read from multiple sources in parallel, you need to use multiple file descriptors and, I think, process substitution.
while read line_from_1;
read -u 3 line_from_2; do
echo "From first: $line_from_1"
echo "From second: $line_from_2"
done < <( echo "$first_list" ) 3< <(echo "$second_list")
(Of course, you don't have to use the two variables if they aren't preexisting; just put the code that populates each variable in the appropriate process substitution that feeds the while loop:
done < <( ...code for first list...) 3< <(...code for second list...)
)
As written, the loop will succeed as long as the second read succeeds (the exit status of the first read is ignored). To loop as long as both succeed, use read line_from_1 && read -u 3 line_from_2.
To loop as long as either succeeds, you'll need a slightly more complicated mini script as the while condition:
while read line_from_1; read1=$?;
read line_from_2; read2=$?;
(( read1 == 0 || read2 == 0 )); do
UPDATE: you can also simply use here strings if the variables are already set in place of the process substitutions. (I wasn't sure if 3<<< was legal.)
while read line_from_1; read -u 3 line_from_2; do
...
done <<< "$first_line" 3<<< "$second_line"
$1st_listand$2nd_list?line1,line2? `line1field1,line2field1,l1f2,l2f2,....'?>>outputfile.csvfrom theechoto a>outputfile.csvafter thedone-- that way you open the output file only once, rather than re-opening it (and then closing it) every single time you want to write a line.