Append to same line in Bash

前端 未结 4 1984
一个人的身影
一个人的身影 2021-02-20 06:50

The file letters.csv contains:

b,a,c,

The file numbers.csv contains:

32
34
25
13

I would like to append numbe

4条回答
  •  暖寄归人
    2021-02-20 07:34

    awk to the rescue!

    $ awk 'NR==FNR{printf "%s",$0; next} 
                  {print $0} 
               END{ORS="\n"; print ""}' letters ORS=, numbers | 
      sed '$s/,$//'    # to delete last ","
    
    b,a,c,32,34,25,13
    

提交回复
热议问题