The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 09-15-2007
cfajohnson's Avatar
cfajohnson cfajohnson is offline
Shell programmer, author
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 974
Quote:
Originally Posted by dhuertas View Post
I have in my directory, n-files, like 1.dhm, 2.dhm, 3.dhm.
These files have 1 column with 1 value per line, like:

1.dhm
------
10
20
30
40
50


2.dhm
------

30
50
20
50
80


What I need here, is to make a result file, adding each per file, in this case:

result.txt
---------
40
70
50
90
130

Code:
paste -d+ *.dhm | bc > result.txt
Reply With Quote