Home > bashism, nerdcore > Command line tool of the day: paste

Command line tool of the day: paste

ever wanted to merge two text files horizontally, line by line? I do have a list of files were I want to associate one entry in each file with its name for plotting in gnuplot:

find ${LOG} -iname "*.log" -path "*${FILTER}*" -exec cat {} \; >times.txt
find ${LOG} -iname "*.log" -path "*${FILTER}*" -exec echo {} \; >names.txt

Now i need one result file with:

name1 time1
name2 time2

The tool i was searching for is called paste and does exactly that:

paste names.txt times.txt

Sometimes I really do love my job (but only sometimes ;))

Categories: bashism, nerdcore Tags: ,
  1. No comments yet.
  1. No trackbacks yet.