Reading lines from two files in one while loop

前端 未结 3 1511
旧时难觅i
旧时难觅i 2020-12-03 18:01

I have a file, file1.csv containing:

This
is
some
text.

I am using while read line to cycle through each line, e.

3条回答
  •  眼角桃花
    2020-12-03 19:00

    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
    

提交回复
热议问题