Jon
Jon

Reputation: 4045

Append string to column on command line

I have a 3 column file. I would like to append a third column which is just one word repeated many times. I tried the following

paste file.tsv <(echo 'new_text') > new_file.tsv

But the text 'new_text' only appears on the first line, not every line.

How can I get 'new_text' to appear on every line.

Thanks

Upvotes: 1

Views: 252

Answers (1)

Arnab Nandy
Arnab Nandy

Reputation: 6692

sed '1,$ s/$/;ABC/' infile > outfile

This replaces the line end ("$") with ";ABC".

Upvotes: 2

Related Questions