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 -->
  #1 (permalink)  
Old 09-14-2007
dhuertas dhuertas is offline
Registered User
 

Join Date: Sep 2007
Posts: 1
Exclamation Help!! Need script to read files and add values by lines...

Hi All, I really need your help. I am a begginner in shell script and I believe this is a very simple issue.

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

Can someone help me?

Thanks!!
Reply With Quote
Remove advertisements
!!
!! Forum Sponsor