🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: [OT] una pregunta de examen

#10657
From: Rafael Moreno Jimenez
Date: Wed, 20 Feb 2002 13:53
38 lines
1701 bytes
Lo siento, no he podido resistirme

for linea in  $(cat fich1.dat); do
  clave=$(echo $linea|cut -f1 -d:)
  profesion=$(grep $clave fich2.dat|cut -f1 -d:)
  echo "$linea::$profesion" >>RESULTADO.DAT
done   

"pip" <correopriv@hotmail.com> wrote in message news:<a4vth7$4qf$1@news.ua.es>...
> Si tenemos dos ficheros con datos
> 
> El fich1.dat contiene:
> 
> 001:Jose:Perez
> 002:Juan:Camps
> 004:Luis:Bisbal
> 003:Pedro:Guerra
> 
> 
> El fich2.dat contiene:
> 
> Pintor:002
> Cantante:004
> Informatico:001
> Compositor:003
> 
> PREGUNTA: �Como se puede generar, con comandos Unix, un fichero
> RESULTADO.DAT que contenga:
> RESULTADO.dat
> 001:Jose:Perez::Informatico
> 002:Juan:Camps::Pintor
> 004:Luis:Bisbal::Cantante
> 003:Pedro:Guerra::Compositor
> 
> Muchas gracias por la atencion.
> Jose.
> 
> (Perdon por el Off Topic)
Technical Details
Message-ID: <74eb6167.0202200553.51a7f4b3@posting.google.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail
References: <a4vth7$4qf$1@news.ua.es>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,cf1b769eafe4ae69
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-02-20 05:53:22 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail
From: laocanfei@yahoo.com (Rafael Moreno Jimenez)
Newsgroups: es.comp.os.linux.programacion
Subject: Re: [OT] una pregunta de examen
Date: 20 Feb 2002 05:53:20 -0800
Organization: http://groups.google.com/
Lines: 38
Message-ID: <74eb6167.0202200553.51a7f4b3@posting.google.com>
References: <a4vth7$4qf$1@news.ua.es>
NNTP-Posting-Host: 194.224.58.37
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1014213201 17723 127.0.0.1 (20 Feb 2002 13:53:21 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 20 Feb 2002 13:53:21 GMT