I have a file, file1.csv
containing:
This
is
some
text.
I am using while read line
to cycle through each line, e.
Use another FD.
while read line; do
if ! read -u 3 line2
then
break
fi
echo "$line***$line2"
done < file1.csv 3< file2.csv
You can use the paste
command:
$ paste -d, file{1,2}.csv | while IFS=, read x y; do echo "$x:$y"; done
This:A
is:B
some:C
text.:D
You could try with the paste
utility:
$ cat one
this
is
some
text
$ cat two
1
2
3
4
$ while read a b ; do echo $a -- $b ; done < <(paste one two)
this -- 1
is -- 2
some -- 3
text -- 4