-1

This question is related to this one.

The file text.csv contains:

#some text
some more text
b,a,c,

The file numbers.csv contains:

32
34
25
13

I would like to append numbers.csv to text.csv like this:

#some text
some more text
b,a,c,32,34,25,13

I have tried some of the recommendations in the linked example, but they tend to put everything on one line. I really want to append only to the last line. How can this be done?

Community
  • 1
  • 1
IslandPatrol
  • 261
  • 3
  • 11
  • 2
    What have you tried? This Q will likely be voted as "asking for a tutorial" OR "too broad". Your Q needs to show specific code, with actual inputs, expected outputs, error messages and your thoughts about how you think it should work, v.s. how it is currently working. Read stackoverflow.com/help/mcve to see what is expected for a Q here on StackOverflow. Don't expect people to go looking at links, you should include the relevant information in that link in the body of your Q. Good luck. – shellter Nov 05 '16 at 03:35

1 Answers1

3

sed and paste will solve this

$ sed '$s/$/'"$(paste -sd, numbers)"'/' letters

#some text
some more text
b,a,c,32,34,25,13
chepner
  • 497,756
  • 71
  • 530
  • 681
karakfa
  • 66,216
  • 7
  • 41
  • 56