🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #7989

Re: Leer un fichero

#7989
From: Angel Luis Jiménez Martínez
Date: Thu, 02 Jan 2003 23:11
30 lines
1765 bytes
DK <ionidk@terra.es> wrote:
> Feliz a�o:

> Quiero sacar la media de una serie de datos que tengo almacenados en
> un fichero. El fichero podria ser de la siguiente manera:(datos.txt)
> 15
> 47
> 30
> 80
> 11
> 42
> 65
> 2
> 25
> 23
> 16

> Quiesiera saber como se puede leer ese fichero, ir linea a linea para
> poder acumularlo. Como supondreis no tengo ni idea de hacer scripts,
> pero estoy en ello, si ademas me dijeseis donde puedo enconntrar
> informacion, para la siguiente vez no tendree que preguntar.

> Un saludo.

Una mas, version shell

while read linea
do
	echo "linea= $linea"
done < datos.txt
Technical Details
Message-ID: <av2guj$cng$1@sofora01.uji.es>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.rediris.es!news.uv.es!sofora01.uji.es!not-for-mail
References: <7d4ff0e4.0301020707.6388a1a6@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,5cf283a7acb0d167
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2003-01-02 16:38:03 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.rediris.es!news.uv.es!sofora01.uji.es!not-for-mail
From: Angel Luis Jiménez Martínez <al026635@alumail.uji.es>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Leer un fichero
Date: Thu, 2 Jan 2003 23:11:15 +0000 (UTC)
Organization: Universitat Jaume I
Lines: 32
Sender: Angel Luis Jiménez Martínez <al026635@anubis.uji.es>
Message-ID: <av2guj$cng$1@sofora01.uji.es>
References: <7d4ff0e4.0301020707.6388a1a6@posting.google.com>
NNTP-Posting-Host: anubis.uji.es
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-2
Content-Transfer-Encoding: 8bit
X-Trace: sofora01.uji.es 1041549075 13040 150.128.40.100 (2 Jan 2003 23:11:15 GMT)
X-Complaints-To: news@marti.uji.es
NNTP-Posting-Date: Thu, 2 Jan 2003 23:11:15 +0000 (UTC)
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (AIX/4-3)