Archive

Posts Tagged ‘paste’

Command line tool of the day: paste

July 15th, 2011 No comments

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: ,